Jump to content


Photo
- - - - -

Users PC Name or IP Address


10 replies to this topic

#1 jasjac

jasjac

    Member

  • Members
  • PipPip
  • 25 posts
  • Gender:Male

Posted 20 March 2007 - 04:16 PM

Hi,

Would anybody know of a ProIV (v5.5) call to find out the users Computer Name or IP Address (or both)?

Cheers

Jason

#2 TalentedFool

TalentedFool

    Member

  • Members
  • PipPip
  • 43 posts
  • Gender:Male

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
Thanks

Lee

#3 Lewis Mccabe

Lewis Mccabe

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 455 posts
  • Gender:Male
  • Location:Sarasota, Florida

Posted 22 March 2007 - 04:06 AM

Jasjac,

Attached is a global function from 5.5 VIP but I exported via $XFR so you could use in native. There is a global logic and a file as well. This will return IP address.

Lew

Attached Files



#4 jasjac

jasjac

    Member

  • Members
  • PipPip
  • 25 posts
  • Gender:Male

Posted 26 March 2007 - 08:28 AM

Jasjac,

Attached is a global function from 5.5 VIP but I exported via $XFR so you could use in native. There is a global logic and a file as well. This will return IP address.

Lew


Fantastic. Thanks for that.

Cheers

Jason

#5 chuckl

chuckl

    Member

  • Members
  • PipPip
  • 26 posts
  • Gender:Male
  • Location:Coppell, Texas

Posted 04 May 2007 - 04:59 PM

Lewis,
Can you export this as a .vpx as well, I would appreciate it very much.

thanks in advance
chuckl

#6 Lewis Mccabe

Lewis Mccabe

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 455 posts
  • Gender:Male
  • Location:Sarasota, Florida

Posted 04 May 2007 - 06:13 PM

Jason,

Attached is the vpx as requested.



Lew

Attached Files



#7 Lewis Mccabe

Lewis Mccabe

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 455 posts
  • Gender:Male
  • Location:Sarasota, Florida

Posted 04 May 2007 - 08:56 PM

Correction - Chuckl your vpx is uploaded.

Lew

#8 chuckl

chuckl

    Member

  • Members
  • PipPip
  • 26 posts
  • Gender:Male
  • Location:Coppell, Texas

Posted 04 May 2007 - 08:59 PM

thanks, it's all good

#9 Lewis Mccabe

Lewis Mccabe

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 455 posts
  • Gender:Male
  • Location:Sarasota, Florida

Posted 04 May 2007 - 09:10 PM

Jason,

I did notice some global logics which VIP automatically exported which I may have missed for the native export. Let me know if you had any problems with that.

Lew

#10 Lewis Mccabe

Lewis Mccabe

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 455 posts
  • Gender:Male
  • Location:Sarasota, Florida

Posted 12 May 2007 - 02:44 AM

Jason,

You can get the computer name by adding the ALL switch to IPCONFIG command. Sorry I didn't post that sooner.

Lew

#11 Glenn Meyers

Glenn Meyers

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 221 posts
  • Gender:Male
  • Location:St. Louis, MO, United States
  • Interests:I also raise African Gray Parrots and build hot rod automobiles.

Posted 15 May 2007 - 03:21 PM

Anyone done this on the 4.6 Kernel?

Glenn



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users