VB through HTTP call verification code SMS Interface source code

Source: Internet
Author: User

Through the authentication code SMS HTTP call interface, you can quickly integrate the mobile phone number verification function in the website or the app, which is just the core code, can be expanded according to your actual needs.

The demo is VB through the HTTP Call verification code SMS interface source code;

VERSION 5.00Object = "{248dd890-bb45-11cf-9abc-0080c7e7b78d} #1.0#0"; "Mswinsck.ocx" Begin VB.   Form Form1 Caption = "Form1" clientheight = 4740 clientleft = ClientTop = 450 ClientWidth = 5940 LinkTopic = "Form1" ScaleHeight = 4740 ScaleWidth = 5940 Startuppos      ition = 2 ' screen center Begin mswinsocklib.winsock Winsock1 left = 4920 Top = 4200 _extentx = 741 _extenty = 741 _version = 393216 End Begin VB.    TextBox Text4 Height = left = TabIndex = 4 Text = $ "form1.frx": 0000 Top = Width = 5415 End Begin VB.    TextBox Text3 Height = left = TabIndex = 3 Text = "Mobile number" Top = 840 Width = 2775 End Begin VB. TextBox TexT2 Height = left = TabIndex = 2 Text = "Password" Top = 480 Width = 2775 End Begin VB.    TextBox Text1 Height = left = TabIndex = 1 Text = "User name" Top = Width = 2775 End Begin VB. CommandButton Command1 Caption = "commit" Height = 495 left = 3720 Tab Index = 0 Top = Width = 1215 End Begin VB.            Label Label2 AutoSize =-1 ' True Caption = ' Label2 ' Height =            = TabIndex = 6 Top = 2160 Visible = 0 ' False Width = 540 End Begin VB. Label Label1 AutoSize =-1 ' True Caption = "state" Height =   TabIndex = 5 Top = Width = 360 Endendattribute vb_name = "Form1" Attribute vb_globalnamespace = Falseattribute vb_creatable = Falseattribute VB_Predecla RedId = Trueattribute vb_exposed = falseprivate Sub form_load () Winsock1.protocol = Scktcpprotocol Winsock1.RemoteHo st = "106.ihuyi.com" Winsock1.RemotePort = winsock1.connect DoEvents If winsock1.state <> 7 T Hen Label1.Caption = "Status: Server Connection succeeded" & Chr Text1.Text = "username" text2.text = "password" Text3.text = "mobile phone number &A MP;CODING=GBK "' &AMP;CODING=GBK do not remove End subprivate 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 = "+ Text1.Text +" &password= "+ Text2.text +" &mobile= "+ Text3.text +" &content= "+ text4.text Dim Ai () as Byte Ai = StrcoNV (strWebPage, vbFromUnicode) clength = UBound (Ai) + 1 Str = "Post/webservice/sms.php?method=submit http/1.1" + VbC  RLf 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:kee    P-alive "+ vbCrLf str = str +" host:106.ihuyi.com "+ vbCrLf str = str +" ACCEPT-LANGUAGE:ZH-CN, en, * "+ vbCrLf  str = str + "Accept-encoding:gzip, deflate" & vbCrLf str = str & "Content-length:" & Len (postdata) & VbCrLf & vbCrLf str = str & postdata & vbCrLf ' MsgBox str strwebpage = "http://106.ihuyi.com//we  Bservice/sms.php?method=submit&account= "+ Text1.Text +" &password= "+ Text2.text +" &mobile= "+ Text3.Text + "&content=" + text4.text strcommand = "GET" + strWebPage + " http/1.0 "+ vbCrLf strcommand = strcommand + vbCrLf If winsock1.state <> 7 then Winsock1.proto        Col = Scktcpprotocol Winsock1.RemoteHost = "106.ihuyi.com" Winsock1.RemotePort = Winsock1.Connect DoEvents winsock1.senddata Str Else winsock1.senddata strcommand End If ' Label1.Caption = "Status:" & Strstate & chr & strcommand & Chr (All) End subprivate Sub winsock1_dataarrival (ByVal bytes Total as Long) Dim Rec () as Bytewinsock1.getdata Rec, vbstring ' MsgBox Utf8tounicode (Right (rec.)) label2.visible = Truel Abel2. Caption = Utf8tounicode (rec) winsock1.closeend Sub
self-application account address:http://www.ihuyi.com/product.php
Full interface file address:Http://www.ihuyi.com/upload/file/cu-fa-jie-kou.rar 

VB through HTTP call verification code SMS Interface source code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.