Advertisement
Guest User

Untitled

a guest
Feb 18th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. Imports System.Net.Sockets
  2.  
  3. End Sub
  4.  
  5. Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  6.  
  7. End Sub
  8.  
  9. Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
  10.  
  11. Try
  12. Dim rcvbytes(TCPServer.ReceiveBufferSize) As Byte
  13. TCPServer.Receive(rcvbytes)
  14. username = System.Text.Encoding.ASCII.GetString(rcvbytes)
  15. Catch ex As Exception
  16. End Try
  17. System.Threading.Thread.Sleep(3000)
  18. Try
  19. Dim rcvbytes2(TCPServer.ReceiveBufferSize) As Byte
  20. TCPServer.Receive(rcvbytes2)
  21. password = System.Text.Encoding.ASCII.GetString(rcvbytes2)
  22. Catch ex As Exception
  23. End Try
  24. Label1.Text = username
  25. Label2.Text = password
  26. End Sub
  27.  
  28. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  29. TCPListenerz = New TcpListener(IPAddress.Any, 1000)
  30. TCPListenerz.Start()
  31. TCPServer = TCPListenerz.AcceptSocket()
  32. TCPServer.Blocking = False
  33. Timer1.Enabled = True
  34. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement