互億無(wú)線·讓通信更簡(jiǎn)單

互億無(wú)線 > 行業(yè)資訊 > 驗(yàn)證碼短信接口VB6調(diào)用http源碼

驗(yàn)證碼短信接口VB6調(diào)用http源碼

2013-07-25 02:06:45

通過(guò)驗(yàn)證碼短信http調(diào)用接口,您可以很快速的在網(wǎng)站或者app中集成手機(jī)號(hào)驗(yàn)證功能,該源碼只是核心代碼,具體可以根據(jù)您的實(shí)際需求進(jìn)行擴(kuò)展。

VERSION 5.00

Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "Mswinsck.OCX"

Begin VB.Form Form1 

   Caption         =   "Form1"

   ClientHeight    =   4740

   ClientLeft      =   120

   ClientTop       =   450

   ClientWidth     =   5940

   LinkTopic       =   "Form1"

   ScaleHeight     =   4740

   ScaleWidth      =   5940

   StartUpPosition =   2  '屏幕中心

   Begin MSWinsockLib.Winsock Winsock1 

      Left            =   4920

      Top             =   4200

      _ExtentX        =   741

      _ExtentY        =   741

      _Version        =   393216

   End

   Begin VB.TextBox Text4 

      Height          =   270

      Left            =   360

      TabIndex        =   4

      Text            =   $"Form1.frx":0000

      Top             =   1200

      Width           =   5415

   End

   Begin VB.TextBox Text3 

      Height          =   270

      Left            =   360

      TabIndex        =   3

      Text            =   "手機(jī)號(hào)碼"

      Top             =   840

      Width           =   2775

   End

   Begin VB.TextBox Text2 

      Height          =   270

      Left            =   360

      TabIndex        =   2

      Text            =   "密碼"

      Top             =   480

      Width           =   2775

   End

   Begin VB.TextBox Text1 

      Height          =   270

      Left            =   360

      TabIndex        =   1

      Text            =   "用戶名"

      Top             =   120

      Width           =   2775

   End

   Begin VB.CommandButton Command1 

      Caption         =   "提 交"

      Height          =   495

      Left            =   3720

      TabIndex        =   0

      Top             =   240

      Width           =   1215

   End

   Begin VB.Label Label2 

      AutoSize        =   -1  'True

      Caption         =   "Label2"

      Height          =   180

      Left            =   360

      TabIndex        =   6

      Top             =   2160

      Visible         =   0   'False

      Width           =   540

   End

   Begin VB.Label Label1 

      AutoSize        =   -1  'True

      Caption         =   "狀態(tài)"

      Height          =   180

      Left            =   360

      TabIndex        =   5

      Top             =   1920

      Width           =   360

   End

End

Attribute VB_Name = "Form1"

Attribute VB_GlobalNameSpace = False

Attribute VB_Creatable = False

Attribute VB_PredeclaredId = True

Attribute VB_Exposed = False

Private Sub Form_Load()

    Winsock1.Protocol = sckTCPProtocol

    Winsock1.RemoteHost = "106.ihuyi.com"

    Winsock1.RemotePort = 80

    Winsock1.Connect

    DoEvents

        

    If Winsock1.State <> 7 Then Label1.Caption = "狀態(tài):服務(wù)器連接成功" & Chr(13)

        

    Text1.Text = "用戶名"

    Text2.Text = "密碼"

    Text3.Text = "手機(jī)號(hào)碼&coding=GBK"    '&coding=GBK不要?jiǎng)h除

        

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=" + 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" + 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: 106.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

    'MsgBox str

 

    

    strWebPage = "http://106.ihuyi.com/webservice/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.Protocol = sckTCPProtocol

        Winsock1.RemoteHost = "106.ihuyi.com"

        Winsock1.RemotePort = 80

        Winsock1.Connect

        DoEvents

        Winsock1.SendData Str

    Else

        Winsock1.SendData strCommand

    End If

    

 

 

    'Label1.Caption = "狀態(tài):" & 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 

==================================================================

互億無(wú)線驗(yàn)證碼短信接口及完整源碼下載地址:http://www.422ajvm.cn/duanxin.html 

如有疑問(wèn),請(qǐng)聯(lián)系我們的技術(shù),或者訪問(wèn)我們的網(wǎng)站了解更多信息:http://www.422ajvm.cn/

標(biāo)簽:

互億無(wú)線短信新客優(yōu)惠活動(dòng)

新用戶促銷(xiāo)套餐,首購(gòu)優(yōu)惠,直接下單購(gòu)買(mǎi)

  • 驗(yàn)證碼通知短信200條體驗(yàn)套餐

    10

    0.05元/條 有效期 12個(gè)月

    原價(jià)0.055元/條,9.1折

  • 驗(yàn)證碼通知短信套餐包1萬(wàn)條

    380

    0.038元/條 有效期 12個(gè)月

    原價(jià)0.055元/條,6.9折

  • 驗(yàn)證碼通知短信套餐包5萬(wàn)條

    1,800

    0.036元/條 有效期 12個(gè)月

    原價(jià)0.043元/條,8.4折

在線咨詢
電話咨詢

服務(wù)熱線:

4008 808 898

服務(wù)熱線(工作時(shí)間):

4008 808 898

業(yè)務(wù)咨詢(非工作時(shí)間):

售后咨詢(非工作時(shí)間):

驗(yàn)證碼已發(fā)送到您的手機(jī),請(qǐng)查收!

輸入驗(yàn)證碼后,點(diǎn)擊“開(kāi)通體驗(yàn)賬戶”按鈕可立即開(kāi)通體驗(yàn)賬戶。

收不到短信驗(yàn)證碼?
互億無(wú)線不提供接碼服務(wù),接碼用戶請(qǐng)勿點(diǎn)擊開(kāi)通按鈕。
×