how to get ip of remote machine in a LAN
-
if i have a c# application.exe installed in a remote system can i get the ip of that system if yes plz help me
System.Net.IPAddress[] myIpAddresses = System.Net.Dns.GetHostAddresses(Environment.MachineName);
<Edit> oops, only just saw you wanted remote machine. In that case just specify the HostName instead of
Environment.MachineName
like so...System.Net.IPAddress[] myIpAddresses = System.Net.Dns.GetHostAddresses("SomeComputer");
</Edit> <Edit2> OMG, i think I'm experiencing dyslexia!! If you want to run the app remotely and get its machines IP use the 1st snippet, but like CG said it needs to be sent somewhere... If you have the remote machines
HostName
you can use the 2nd snippet on the local machine. </Edit2>Harvey Saayman - South Africa Software Developer .Net, C#, SQL
you.suck = (you.Occupation == jobTitles.Programmer && you.Passion != Programming)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111modified on Monday, September 7, 2009 5:22 AM
-
if i have a c# application.exe installed in a remote system can i get the ip of that system if yes plz help me
Yes, if you write an app that runs on that remote machine, it can read and broadcast the IP address if you like. Of course, it needs somewhere to send it.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
System.Net.IPAddress[] myIpAddresses = System.Net.Dns.GetHostAddresses(Environment.MachineName);
<Edit> oops, only just saw you wanted remote machine. In that case just specify the HostName instead of
Environment.MachineName
like so...System.Net.IPAddress[] myIpAddresses = System.Net.Dns.GetHostAddresses("SomeComputer");
</Edit> <Edit2> OMG, i think I'm experiencing dyslexia!! If you want to run the app remotely and get its machines IP use the 1st snippet, but like CG said it needs to be sent somewhere... If you have the remote machines
HostName
you can use the 2nd snippet on the local machine. </Edit2>Harvey Saayman - South Africa Software Developer .Net, C#, SQL
you.suck = (you.Occupation == jobTitles.Programmer && you.Passion != Programming)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111modified on Monday, September 7, 2009 5:22 AM
-
Have application.exe get the IP address, and write it into a SQL database. That would be the easiest way to do it...
Harvey Saayman - South Africa Software Developer .Net, C#, SQL
you.suck = (you.Occupation == jobTitles.Programmer && you.Passion != Programming)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111 -
Have application.exe get the IP address, and write it into a SQL database. That would be the easiest way to do it...
Harvey Saayman - South Africa Software Developer .Net, C#, SQL
you.suck = (you.Occupation == jobTitles.Programmer && you.Passion != Programming)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111