Realizing __vb of simple service-end in VB

Source: Internet
Author: User

' Create a new standard EXE ' project, add a Winsock control to the form, default to Winsock1 with the name, and set index to 0.

Option Explicit

Dim Intmax as Long

Private Sub Form_Load ()
Intmax = 0
Winsock1 (0). LocalPort = 60001
Winsock1 (0). Listen
End Sub

Private Sub winsock1_connectionrequest (Index as Integer, ByVal RequestID as Long)
If Index = 0 Then
Intmax = Intmax + 1
Load Winsock1 (Intmax)
If Winsock1 (Intmax). State <> sckclosed Then
Winsock1 (Intmax). Close
End If
Winsock1 (Intmax). Accept RequestID
End If
End Sub

Private Sub Winsock1_dataarrival (Index as Integer, ByVal bytestotal as Long)
If bytestotal = 408 Then
Winsock1 (Intmax). SendData "7D+01+00+00+34+12+34+12+01+00+00+00+6D+01+00+00+D1+8D+8C+8C+8D+8D+8C+8C+8C+8C+8C+8C+8C+8C+8C+8C+E2+FC +e2+b5+bc+bd+b8+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+b4+b4+b4+b4+b4+b4+b4+b4+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+ 8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8d+8c+8c+8c+8d+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c +8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+ 8C+8C+8C+8C+8C+8C+8C+8C+8C+8C+8C+8C+8C+8C+8C+8C+8C+8C+8C+8C+8C+8C+8C+8C+8C+8C+8C+8C+8C+8C+8C+8C+8C+FB+EA+BF " & _
"+ae+92+8c+8c+8c+4d+8c+8c+8c+d7+df+c9+dc+a2+e9+f4+e9+d1+f0+df+d8+de+bd+b1+f0+df+d8+de+be+b1+e5+eb+eb+e7+e9+ea+ Ea+ed+f0+df+d8+de+bf+b1+f0+df+d8+de+b8+b1+f0+c8+db+bd+b1+bc+f0+c8+db+be+b1+bd+ba+f0+df+d8+de+b9+b1+fa+e9+fe+bd +a2+bf+bb+be+f0+df+d8+de+ba+b1+f0+df+d8+de+bb+b1+f0+c8+db+bf+b1+be+f0+df+d8+de+b4+b1+bd+a0+b8+a0+b8+a0+bc+a0+ B4+a0+bc+a0+bc+a0+bf+bc+bc+bc+a0+bf+bc+bc+bc+a0+bd+bc+bc+a0+bc+f4+be+bc+a0+bc+f4+bd+bc+b5+bd+b9+ed+e9+be+a0+bc +f4+bd+bc+b5+be+cf+c9+c8+b8+a0+bd+a0+bc+f4+bd+bc+bd+b9+c8+b9+b9+cf+a0+bc+f4+bd+bc+bc+b5+b5+b8+bf+cf+a0+bc+f4+ bd+bc+bc+ca+b9+bd+b8+cf+a0+bc+f4+ca+ca+ca+ca+ca+ca+ca+ca+f0+ "
ElseIf bytestotal = 468 Then
Winsock1 (Intmax). SendData "A0+00+00+00+34+12+34+12+01+00+00+00+90+00+00+00+0c+8c+8c+8c+9d+8d+8c+8c+8c+8c+8c+8c+8c+8c+8c+8c+fb+ea +bf+ae+8d+8c+8c+8c+b0+18+b9+8d+a8+3f+aa+be+c2+35+a8+c9+c6+cf+54+eb+c8+95+03+05+c0+22+cf+26+1a+9c+fa+40+02+11+ D0+62+64+ee+2c+9c+ec+98+76+be+52+e2+cc+db+0a+d4+8b+f5+b8+49+d5+17+b8+68+22+31+0a+2c+04+52+a6+55+c2+8d+bc+06+eb +af+14+72+a3+c8+9e+c4+54+ea+52+3d+1a+04+50+8e+88+20+f0+e5+bb+42+92+5c+e6+7c+4e+ba+12+9e+e4+11+5d+b8+9c+88+89+ db+36+e6+b4+f5+ea+5d+e7+17+98+b4+13+31+48+12+5e+53+ "& String (chr$ (0))
End If
End Sub

Private Sub winsock1_close (Index as Integer)
Winsock1 (Intmax). Close
End Sub

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.