Dark Slipstream Posted May 12, 2009 Report Posted May 12, 2009 (edited) ------------- External IP ------------- Try Dim WC As New System.Net.WebClient MsgBox(System.Text.Encoding.ASCII.GetString(WC.DownloadData("http://www.swlink.net/~styma/REMOTE_ADDR.shtml"))) MsgBox(System.Text.Encoding.ASCII.GetString(WC.DownloadData("http://whatismyip.com/automation/n09230945.asp"))) WC.Dispose() Catch 'Display Error Message End Try ------------- Internal IP ------------- Try Dim ipEntry As System.Net.IPHostEntry = Net.Dns.GetHostEntry(Environment.MachineName) Dim IpAddr As System.Net.IPAddress() = ipEntry.AddressList MsgBox(IpAddr(0).ToString()) Catch 'Display Error Message End Try --------------- Address to IP --------------- If Not T2.Text = "" Then Try ipE = Dns.GetHostEntry(T2.Text) Catch MessageBoxEx.Show("Site does not exist!", "DoS", MessageBoxButtons.OK, MessageBoxIcon.Information) End Try Dim IpA() As IPAddress = ipE.AddressList TX.Text = IpA(0).ToString End If Edited September 9, 2009 by iBotPeaches 1
yungbol Posted May 12, 2009 Report Posted May 12, 2009 I made one of these a while ago (posted in General Discussion a long time back) and used the TCP connection way. I forget exactly though.
Joe Walls Posted May 12, 2009 Report Posted May 12, 2009 I still don't know what to do with these as far as buttons labels etc. and where to paste them :\
Dark Slipstream Posted May 12, 2009 Author Report Posted May 12, 2009 Only way I knew how to do it. You can dump the output of ipconfig in cmd, and display it that way too, but people won't understand it.
yungbol Posted May 12, 2009 Report Posted May 12, 2009 Only way I knew how to do it. You can dump the output of ipconfig in cmd, and display it that way too, but people won't understand it. Do a tutorial on that I wanted to look up displaying cmd outputs, got too lazy...
Dark Slipstream Posted May 12, 2009 Author Report Posted May 12, 2009 Yes, but it's alot cleaner. "" gives it a null char. nothing is exactly what it is, "Nothing".
yungbol Posted May 12, 2009 Report Posted May 12, 2009 You make it a sub, then to use it, label1.Text = InternalIP.
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now