
Users PC Name or IP Address
Started by jasjac, Mar 20 2007 04:16 PM
10 replies to this topic
#2
Posted 21 March 2007 - 05:27 PM
There's no single call that you can use to find out the hostname of the users computer or the IP address (though you can find the server name by using &$@~COMPUTERNAME).
I wanted something like this a while back and wrote a function that basically ran the DOS command 'hostname | nslookup > C:\host.txt' which pipes the outout of the command to the host.txt file and provided you have an internal DNS server setup and everything is fine then the output in the file should look like the following: (Not sure what it looks like without a DNS Server ?)
==start
Default Server: dnsServer.corp.co.uk
Address: 192.168.0.1
> Server: dnsServer.corp.co.uk
Address: 192.168.0.1
Name: MyMachine.corp.co.uk
Address: 192.168.0.2
>
==end
the rest of the function then basically dealt with reading that text file ignoring everything until it found the Name line and used the information from that line and the address line to give me what I wanted.
Should be easy to code again - not sure if I still have the system that I did that in. If I have and have time I'll see if I can dig it out and post the prx for you (but don't breath)
Lee
I wanted something like this a while back and wrote a function that basically ran the DOS command 'hostname | nslookup > C:\host.txt' which pipes the outout of the command to the host.txt file and provided you have an internal DNS server setup and everything is fine then the output in the file should look like the following: (Not sure what it looks like without a DNS Server ?)
==start
Default Server: dnsServer.corp.co.uk
Address: 192.168.0.1
> Server: dnsServer.corp.co.uk
Address: 192.168.0.1
Name: MyMachine.corp.co.uk
Address: 192.168.0.2
>
==end
the rest of the function then basically dealt with reading that text file ignoring everything until it found the Name line and used the information from that line and the address line to give me what I wanted.
Should be easy to code again - not sure if I still have the system that I did that in. If I have and have time I'll see if I can dig it out and post the prx for you (but don't breath)
Lee
Thanks
Lee
Lee
Reply to this topic

0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users