|
-
Mar 4th, 2007, 08:45 PM
#13
Frenzied Member
Re: [2005] Retrieve Remote IP Address
 Originally Posted by getlowdogg369
vb Code:
Imports System.Net
Imports System.Text.Encoding
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = Nothing
Dim tcp As New Sockets.Socket(Sockets.AddressFamily.InterNetwork, Sockets.SocketType.Raw, Sockets.ProtocolType.Raw)
tcp.Connect(TextBox2.Text, 80)
If tcp.Connected = False Then Exit Sub
tcp.Send(ASCII.GetBytes("GET / HTTP/1.0" & vbCrLf & vbCrLf))
Dim buf(1024) As Byte
Dim bytes As Int32 = tcp.Receive(buf, 1024, 0)
TextBox1.Text &= ASCII.GetString(buf, 0, bytes)
Do While bytes > 0
bytes = tcp.Receive(buf, 1024, 0)
TextBox1.Text &= ASCII.GetString(buf, 0, bytes)
Loop
End Sub
End Class
That's my exact code straight out of the program. Also, I'm not receiving any errors/warnings. I've typed "www.google.com" without the quotes into TextBox2 and it still frozed. Also, how does this give the client his/her computer's remote IP address? I just want it to do basically the same as IP Chicken or www.whatismyip.org.
Code:
Dim tcp As New Sockets.Socket(Sockets.AddressFamily.InterNetwork, Sockets.SocketType.Stream, Sockets.ProtocolType.Tcp)
forgot I changed it when messing around.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|