Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click Dim obj As Object Dim ServerIp As String Dim ServerPort As String Dim UserID As String Dim Passwd As String Dim MobileNum As String Dim Message As String Dim ret_code As Integer Dim ret_description As String obj = CreateObject("S2ACOM.S2Air.1") ServerIp = "203.66.172.131" UserID = "帳號" Passwd = "密碼" ServerPort = CLng("8000") MobileNum = "接收簡訊的手機號碼" Message = "測試" ret_description = "HELLO" '建立連線 Call obj.StartCon(ServerIp, ServerPort, UserID, Passwd, ret_code) '傳送簡訊,如欲傳送多則,請多次呼叫SendMsg即可。 Call obj.SendMsg(MobileNum, Message, ret_code, ret_description) 'ret_code為回傳值 'ret_description為回傳訊息 '結束連線 Call obj.EndCon() End Sub