factory909 Posted June 23, 2009 Share Posted June 23, 2009 I am trying to write just a simple application with VB2008, one form, 2 buttons, the 1st button gets the hostname, the 2nd button needs to get the ip address of the machine its ran on. the first button works. heres what I got for button 2:Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim ip As String Dim resolve As Decimal ip = (Net.Dns.GetHostName) resolve = (Net.Dns.GetHostAddresses(ip)) MessageBox.Show(resolve) End Sub Link to comment Share on other sites More sharing options...
factory909 Posted June 23, 2009 Author Share Posted June 23, 2009 nevermind i think i got it right.System.Net.Dns.GetHostEntry(ip).AddressList(0).ToString Link to comment Share on other sites More sharing options...
jcarle Posted August 1, 2009 Share Posted August 1, 2009 Correct. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now