| View previous topic :: View next topic |
| Author |
Message |
harry Contributor


Joined: 01 May 2003 Posts: 61
|
Posted: Tue May 20, 2003 9:52 pm Post subject: is there a better way?? |
|
|
Say guys,
is there a better/eaisier way of getting your ip# than this?
maybe piping rezultz to VDS directly?
run winipcfg.exe /batch
list create,1
list loadfile,1,A:\winipcfg.out
repeat
%Z = @NEXT(1)
if @MATCH(1,IP ADDRESS)
%%IP_ADDRESS = @TRIM(@STRDEL(@NEXT(1),1,@POS(":",@NEXT(1))))
else
end
until @NOT(@OK(1))
list close,1
file delete,A:\winipcfg.out
TIA
harry |
|
| Back to top |
|
 |
Hortalonus Valued Contributor


Joined: 15 Mar 2002 Posts: 344 Location: Western USA
|
Posted: Tue May 20, 2003 10:01 pm Post subject: |
|
|
From the VDSINET.DLL Help file...
| Quote: | @NET(SOCKET, ADDR)
Client/server, auto on/auto off
This returns your IP address. |
If you want to use a DLL you should be able to use this function. _________________ "ah, come take my hand... we're ridin' out tonight to face the promised land"
Get a free iPod mp3 player... |
|
| Back to top |
|
 |
harry Contributor


Joined: 01 May 2003 Posts: 61
|
Posted: Tue May 20, 2003 10:24 pm Post subject: |
|
|
Ho,
THANK YOU!!
i knew that it was the long way home, but
with all these dlls now its hard to know whats in em.
Tanx,
harry |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Wed May 21, 2003 5:33 am Post subject: |
|
|
There's another one - vdsonline.dll which can show you your IP address + online status. Beware though, that
if you are on a network, behind a router/switch etc. there will often be a difference between your local IP and
the external IP which your computer has on the Internet.
Greetz
Dr. Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Wed May 21, 2003 12:05 pm Post subject: |
|
|
He-he. Yeah or
in Perl:
| Code: | #!/usr/local/bin/perl
print "Content-type: text/html\n\n";
print "$ENV{REMOTE_ADDR}"; |
or ASP:
| Code: | | <% Response.Write Request.ServerVariables(32) %> |
Greetz
Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
| Back to top |
|
 |
moke Contributor

Joined: 02 Jan 2002 Posts: 162
|
Posted: Wed May 21, 2003 2:47 pm Post subject: |
|
|
Since all the good answers have been given already here's a not so good
one (depending on the reason you want the IP). At least it's a different
approach.
You can get all the IP info including gateways, DHCP info, MASKS, Lease
info etc. if you know the MAC address of your network connection
(including dialup) from the registry. The keys below should work with NT,
2000 or XP. It's easy enough to find them in 95,98 & ME with a little work.
Get the Mac Address(s) Here:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards
The MAC Address is labeled ServiceName and you can load all the connections into a list for processing
Get IPINFO at one of the following:
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\{MAC ADDRESS}\Parameters\Tcpip
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Tcpip\Parameters\Interfaces\{MAC ADDRESS}
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\{MAC ADDRESS}\Parameters\Tcpip
I haven't tried this method personally yet but it does seem do-able and I just HAD to throw in my 2 cents.
moke |
|
| Back to top |
|
 |
|