This script below tries to demonstrate to find your computer gateway. Your gateway is very important in connecting to your computer network. Please notify that Your Ip Address is still possible to be detected.
local vServer, vAdapters, vAdapter
vServer = GetObject("winmgmts:\\" + "." + "\root\cimv2")
vAdapters = vServer.ExecQuery(;
"SELECT * FROM Win32_NetworkAdapterConfiguration")
create cursor csResult (;
ObjectCaption C(50),;
Gateway C(50),;
IPAddress C(20),;
MACAddress C(20),;
IPXAddress C(20),;
ServiceName C(50),;
DHCPServer C(50),;
DNSHostName C(50);
)
local vGateway
for each vAdapter in vAdapters
with vAdapter
if .IPEnabled
vGateway = iif(isnull(.DefaultIPGateway), "",;
.DefaultIPGateway[0])
insert into csResult values (;
nvl(.Caption, ""),;
nvl(vGateway, ""),;
nvl(.IPAddress[0], ""),;
nvl(.MACAddress, ""),;
nvl(.IPXAddress, ""),;
nvl(.ServiceName, ""),;
nvl(.DHCPServer, ""),;
nvl(.DNSHostName, "");
)
endif
endwidth
next
select csResult
go top
browse normal nowait
It has already been tested. You are right, the script is on Visual Foxpro but that is not for the expert only. I am sure you can do it.
Best,
-Dj-