0

大家好,所以我正在尝试使用 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

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

任何帮助表示赞赏,谢谢。

4

1 回答 1

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

于 2016-09-18T13:04:13.627 回答