2014-04-01 72 views

回答

0

如果你還在疑惑,這是

註冊時您oSkype,使其 「WITHEVENTS」:這樣做

Public WithEvents oSkype As New SKYPE4COMLib.Skype 

然後,一旦有事件,你需要處理CallStatus事件:

Private Sub oSkype_CallStatus(pCall As SKYPE4COMLib.Call, Status As SKYPE4COMLib.TCallStatus) Handles oSkype.CallStatus 

End Sub 

然後,在此處理程序,您需要檢查狀態正在振鈴:

If Status = SKYPE4COMLib.TCallStatus.clsRinging Then 

End If 

然後,最後,你需要結束通話,如果它是:

pCall.Finish() 

所以,在所有的,你的代碼應該是:

Public Class Form1 
Public WithEvents oSkype As New SKYPE4COMLib.Skype 
Private Sub oSkype_CallStatus(pCall As SKYPE4COMLib.Call, Status As SKYPE4COMLib.TCallStatus) Handles oSkype.CallStatus 
    If Status = SKYPE4COMLib.TCallStatus.clsRinging Then 
     pCall.Finish() 
    End If 
End Sub 
End Class 

從這裏就可以修改這個拒絕來自某個用戶的呼叫,允許某些用戶等,但你可以科幻指出你自己。