我花了很多时间.整个Skype论坛似乎已经破裂或死亡,或者他们没有技术人员来处理这些领域.
入门代码示例不起作用或不起作用(完全异常).例如:http://forum.skype.com/index.php?showtopic = 3557
因此,我请求有人可以请给我一个简单的C#工作代码示例如何一步一步地开始.
提前致谢.
添加对skype COM库的引用
添加以下类并开始探索skype.
代码(包括使用SKYPE4COMLib;,它搞砸了stackoverflow语法高亮显示)
namespace Example { class SkypeExample { private SkypeClass _skype; public SkypeExample() { _skype = new SkypeClass(); _skype.MessageStatus += OnMessage; _skype._ISkypeEvents_Event_AttachmentStatus += OnAttach; _skype.Attach(7, false); } private void OnAttach(TAttachmentStatus status) { // this app was successfully attached to skype } private void OnMessage(ChatMessage pmessage, TChatMessageStatus status) { // dont do anything if the message is not received (i.e. we are sending a emssage) if (status != TChatMessageStatus.cmsReceived) return; // simple echo service. _skype.get_Chat(pmessage.ChatName).SendMessage(pmessage.Body); } public bool MakeFriend(string handle) { for (int i = 1; i <= _skype.Friends.Count; i++) { if (_skype.Friends[i].Handle == handle) return true; } UserCollection collection = _skype.SearchForUsers(handle); if (collection.Count >= 1) collection[1].BuddyStatus = TBuddyStatus.budPendingAuthorization; return false; } } }