互亿无线 · 文档中心

语音验证码 - 代码示例


VB6对接语音验证码接口DEMO示例
本文为您提供了VB6语言版本的语音验证码接口对接DEMO示例

语音验证码接口文档 点击下载

语音验证码接口接入指南 点击访问

Private Sub Form_Load()
    Winsock1.Protocol = sckTCPProtocol
    Winsock1.RemoteHost = "api.voice.ihuyi.com"
    Winsock1.RemotePort = 80
    Winsock1.Connect
    DoEvents
         
    If Winsock1.State <> 7 Then Label1.Caption = "状态:服务器连接成功" & Chr(13)
         
    Text1.Text = "用户名"
    Text2.Text = "密码为APIKEY(可以登录用户中心查看)"
    Text3.Text = "手机号码"
    Text4.Text = "1125"
         
End Sub
Private Sub Command1_Click()
 
    On Error Resume Next
 
    Dim PostData As String
    Dim Str As String
      
    Dim strWebPage As String
    Dim strCommand As String
         
    PostData = "account=" + toUTF8(Text1.Text) + "&password=" + toUTF8(Text2.Text) + "&mobile=" + toUTF8(Text3.Text) + "&content=" + toUTF8(Text4.Text)
     
    Dim Ai() As Byte
    Ai = StrConv(strWebPage, vbFromUnicode)
    CLength = UBound(Ai) + 1
    Str = "POST /webservice/voice.php?method=Submit HTTP/1.1" + vbCrLf
    Str = Str + "Accept: */*" + vbCrLf
    Str = Str + "Content-Type: application/x-www-form-urlencoded" + vbCrLf
    Str = Str + "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; Maxthon; .NET CLR 1.1.4322)" & vbCrLf
    Str = Str + "Language: zh-CN, zh, *" + vbCrLf
    Str = Str + "Connection: Keep-Alive" + vbCrLf
    Str = Str + "Host: api.voice.ihuyi.com" + vbCrLf
    Str = Str + "Accept-Language: zh-CN, zh, *" + vbCrLf
    Str = Str + "Accept-Encoding: gzip, deflate" & vbCrLf
    Str = Str & "Content-Length: " & Len(PostData) & vbCrLf & vbCrLf
    Str = Str & PostData & vbCrLf
 
 
     
    strWebPage = "http://api.voice.ihuyi.com/webservice/voice.php?method=Submit&account=" + toUTF8(Text1.Text) + "&password=" + toUTF8(Text2.Text) + "&mobile=" + toUTF8(Text3.Text) + "&content=" + toUTF8(Text4.Text)
    strCommand = "GET " + strWebPage + " HTTP/1.0" + vbCrLf
    strCommand = strCommand + vbCrLf
     
    'MsgBox strWebPage
     
    If Winsock1.State <> 7 Then
        Winsock1.Protocol = sckTCPProtocol
        Winsock1.RemoteHost = "api.voice.ihuyi.com"
        Winsock1.RemotePort = 80
        Winsock1.Connect
        DoEvents
        Winsock1.SendData Str
    Else
        Winsock1.SendData strCommand
    End If
     
 
 
    'Label1.Caption = "状态:" & strState & Chr(13) & strCommand & Chr(13)
     
End Sub
 
 
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim rec() As Byte
Winsock1.GetData rec, vbString
'MsgBox Utf8ToUnicode(Right(rec, 150))
 
Label2.Visible = True
Label2.Caption = Utf8ToUnicode(rec)
 
Winsock1.Close
End Sub


语音验证码接口
语音验证码+短信验证码双重保证;
无需额外开发,在平台直接配置即可使用。
24小时发送 失败自动重呼 企业独享外呼号码 自助配置语音+短信验证码
自助开通语音验证码免费试用账户

现在注册,即享新用户礼包!

在线咨询
电话咨询
服务热线:
4008 808 898



验证码已发送到您的手机,请查收!

填写验证码后,点击“开通体验账户”自动开通体验账户。

收不到短信验证码?
×