Joke Collection Website - Blessing messages - How to send short messages with vb
How to send short messages with vb
In which UDP
Protocol is a connectionless protocol, and the transmission between two computers is similar to the delivery of mail: messages are sent from one computer to another, but there is no clear connection between them. In addition, the maximum amount of data transmitted at a time depends on the specific network.
To create a UDP partner, follow these steps:
Create a new standard EXE project.
Change the name of the default form to frmPeerA.
Change the title of the table to "Peer A".
Place a Winsock control in the form and name it udpPeerA.
On the Properties page, click Protocol and modify the protocol to UDPProtocol.
Add two TextBox controls to the form. Name the first one txtSend and the second one txtOutput.
Add the following code to the form.
Private? Sub? Form_Load()
The name of the control is. Udpera
With what? Udpera
Important: you must put? RemoteHost? The value of
Change to the name of the computer.
. RemoteHost=? " PeerB "?
. RemotePort? =? 100 1? Port number of the connection.
. Binding? "1002" is bound to the local port.
End? along with
frmPeerB。 Show? Show the second form.
End? submarine
Private? Sub? txtSend_Change()
Send text as you type.
Upera. Send data? txtSend。 text
End? submarine
Private? Sub? udpPeerA_DataArrival? _
(ByVal? bytesTotal? As? Dragon)
Dim? strData? As? line
Upera. GetData? strData
txtOutput。 Words? =? strData
End? Sub To create a second UDP partner, please follow these steps:
Add a standard form to the project.
Change the name of the form to frmPeerB.
Change the title of the table to "Peer B".
Place a Winsock control in the form and name it udpPeerB.
On the Properties page, click Protocol and modify the protocol to UDPProtocol.
Add two TextBox controls to the form. Name the first one txtSend and the second one txtOutput.
Add the following code to the form.
Private? Sub? Form_Load()
The name of the control is. udpPeerB .
With what? udpPeerB
Important: you must put? RemoteHost? Change the value of to
The name of the computer.
. RemoteHost=? "Pyrah"
. RemotePort? =? 1002' port to be connected.
. Binding? "100 1" is bound to the local port.
End? along with
End? submarine
Private? Sub? txtSend_Change()
Send text immediately after typing.
udpPeerB。 Send data? txtSend。 text
End? submarine
Private? Sub? udpPeerB_DataArrival? _
(ByVal? bytesTotal? As? Dragon)
Dim? strData? As? line
udpPeerB。 GetData? strData
txtOutput。 Words? =? strData
End? submarine
- Related articles
- A short thank you message for receiving a gift
- What should I do if I send too many verification codes when sharing the operation of iQiyi members with others?
- What is a vehicle electronic fence? What does electronic fence mean to cars?
- What do the outbound marketing and business acceptance personnel of China Telecom do?
- Briefs issued by friends circle on National Legal Publicity Day
- I reported it after receiving the text message, but do I still need to report it after receiving the text message?
- Is it true that China exempts Japanese from buying applets?
- Do cell phones send text messages in the early morning, Apple?
- New Year's Day SMS (52 Sentences Collection)
- How to comfort your girlfriend's hard work