如何使用Skype4COMLib在VB.NET中自动接受Skype好友请求?

时间:2016-07-04 06:25:53

标签: vb.net skype skype4com skypedeveloper

大家好,所以我尝试使用VB.NET和Skype4COMLib在我的Skype上自动接受好友请求但我收到此错误:

  

Private Sub oskype_userauthorizationrequestreceived(pUser As SKYPE4COMLib.User)'无法处理事件' Public Event UserAuthorizationRequestReceived(sender As Object,e As AxSKYPE4COMLib._ISkypeEvents_UserAuthorizationRequestReceivedEvent)'因为他们没有兼容的签名。

代码:

 Private Sub oskype_userauthorizationrequestreceived(pUser As User) Handles oSkype.UserAuthorizationRequestReceive 
    If MaterialCheckBox7.Checked = True And pUser.IsAuthorized = False Then
        pUser.IsAuthorized = True
    End If
End Sub

我无法解决问题,每当我点击我的复选框并在取消选中复选框时禁用自动接受请求时,我希望它接受好友请求。

感谢任何帮助,谢谢。

1 个答案:

答案 0 :(得分:0)

很抱歉这个迟到的回复,但错误信息实际上非常清楚。

您的活动订阅目前如下所示:

Private Sub oskype_userauthorizationrequestreceived(pUser As SKYPE4COMLib.User) Handles oSkype.UserAuthorizationRequestReceive

但Skype4Com库的事件声明如下:

Public Event UserAuthorizationRequestReceived(sender As Object, e As AxSKYPE4COMLib._ISkypeEvents_UserAuthorizationRequestReceivedEvent)

您可能会看到缺少一个参数,而第二个参数的类型错误。

修复只是更改参数以匹配事件:

Private Sub oskype_userauthorizationrequestreceived(sender As Object, e As AxSKYPE4COMLib._ISkypeEvents_UserAuthorizationRequestReceivedEvent) Handles oSkype.UserAuthorizationRequestReceive

我猜你可以在查看e参数的属性时提取特定用户。