2013-03-12 54 views
0

我已經查看了代碼,但我根本沒有理解知道哪些函數正在做什麼以及如何與C#主編碼語言相關。將VBScript片段轉換爲C#

Set mSkype = WScript.CreateObject("Skype4COM.Skype", "Skype_") 

ContactName=InputBox ("Enter the contact's Skype User Name" & CHR(13) & "Note that this must be the User Name and not the Display Name", "User Name:") 

If ContactName = "" Then 
    WScript.Quit 
Else 
    If mSkype.User(ContactName).FullName="" then 
     WScript.Echo ("The name " & ContactName & " is not in your Contact List") 
     WScript.Quit 
    End If 
End If 


PictureFileName=InputBox ("Enter the path and name of the Picture" & CHR(13) & "The file extension must be .jpg", "Save Picture as:") 

If PictureFileName="" Then 
    WScript.Quit 
End If 


cmdStr = "GET USER" & " " & ContactName & " " & "AVATAR 1" & " " & PictureFileName 
mSkype.SendCommand mSkype.Command(0, cmdStr) 

哦,我確實有skype4com導入和即時通訊使用該API,這不是轉換的問題。

+1

這項工作似乎在這裏完成:http://community.skype.com/t5/Windows-desktop-client/how-to-get-the-profile-picture-of-users-using-skype4com-api -with/TD-p/444063 – 2013-03-12 13:26:33

回答

0

InputBox是一個窗口,顯示提示輸入。它在VB.NET中可用,並且您可以通過添加對Microsoft.VisualBasic的引用在C#中實際使用它。見here

WScript在VB中也不可用,它可能是研究如何在Skype開發者論壇中使用Skype插件的好方法。 Here是關於如何在C#中使用Skype DLL的鏈接。