我想使用这个C#代码设置我的skype头像:
string path = "C:\\a.jpg";
string cmdstr = "SET AVATAR" + " " + "1" + " " + path;
Command cmd = new Command(0, cmdstr);
skype.SendCommand(cmd);
这段代码不起作用,但是如果我在VBA中使用这段代码就可以了:
Public skype As New Skype
Dim cmdStr, path As String
path = "C:\a.jpg"
cmdStr = "SET AVATAR" + " " + "1" + " " + path
skype.SendCommand skype.Command(0, cmdStr)
它与图像的扩展有关,还是我错过了什么?
答案 0 :(得分:0)
我找到了部分解决方案:
string path = "C:\\b.jpg";
var skype = new SKYPE4COMLib.Skype();
var cmd = new SKYPE4COMLib.Command();
cmd.Command = string.Format("SET AVATAR 1 {0}", path);
skype.SendCommand(cmd);
但该路径仅在图像存储在根目录中时才有效。