我正在尝试在 VB 中的一个类中的方法中实现以下内容,但出现构建错误:
Public Sub sendMessage()
Dim sUrl As String
Dim sAPI_ID, sPassword, sUsername, sMobileNo, sText As String
Dim oXMLHTTP, sPostData, sResult
sUrl = "http://api.clickatell.com/http/sendmsg"
sAPI_ID = "xxxx"
sPassword = "xxxx"
sUsername = "xxxx"
sMobileNo = "xxxx"
sText = "This is an example message"
sPostData = "api_id=" & sAPI_ID
sPostData = sPostData & "&user=" & sUsername
sPostData = sPostData & "&password=" & sPassword
sPostData = sPostData & "&to=" & sMobileNo
sPostData = sPostData & "&text=" & sText
oXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
oXMLHTTP.Open("POST", sUrl, False)
oXMLHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
oXMLHTTP.Send(sPostData)
sResult = oXMLHTTP.responseText
oXMLHTTP = Nothing
Response.Write(sResult)
End Sub
以下两行加下划线,我认为缺少导入:
oXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP")
和
Response.Write(sResult)
谁能告诉我我需要导入什么或缺少什么?