【问题标题】:How to auto accept Skype friend requests in VB.NET using Skype4COMLib?如何使用 Skype4COMLib 在 VB.NET 中自动接受 Skype 好友请求?
【发布时间】:2016-07-04 06:25:52
【问题描述】:

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

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

感谢您的帮助,谢谢。

【问题讨论】:

    标签: vb.net skype skype4com skypedeveloper


    【解决方案1】:

    抱歉回复晚了,但错误信息其实很清楚。

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

    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 参数的属性,我猜您可以提取特定用户。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-11-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-20
      • 1970-01-01
      • 2020-02-28
      相关资源
      最近更新 更多