Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Net.Sockets
- End Sub
- Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- End Sub
- Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
- Try
- Dim rcvbytes(TCPServer.ReceiveBufferSize) As Byte
- TCPServer.Receive(rcvbytes)
- username = System.Text.Encoding.ASCII.GetString(rcvbytes)
- Catch ex As Exception
- End Try
- System.Threading.Thread.Sleep(3000)
- Try
- Dim rcvbytes2(TCPServer.ReceiveBufferSize) As Byte
- TCPServer.Receive(rcvbytes2)
- password = System.Text.Encoding.ASCII.GetString(rcvbytes2)
- Catch ex As Exception
- End Try
- Label1.Text = username
- Label2.Text = password
- End Sub
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- TCPListenerz = New TcpListener(IPAddress.Any, 1000)
- TCPListenerz.Start()
- TCPServer = TCPListenerz.AcceptSocket()
- TCPServer.Blocking = False
- Timer1.Enabled = True
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement