在注册表里有(以下在NT4下,其他也差不多在[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services
这。NdisWan7是设备名,如adsl,isdn等。
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\NdisWan7\Parameters\Tcpip]
"EnableDHCP"=dword:00000000
"UseZeroBroadcast"=dword:00000000
"LLInterface"="\\Device\\RASARP"
"IPAddress"=hex(7):30,2e,30,2e,30,2e,30,00,00
"SubnetMask"=hex(7):30,2e,30,2e,30,2e,30,00,00
"DefaultGateway"=hex(7):00
"MTU"=dword:00000578
"IPInterfaceContext"=dword:00000006
"IPInterfaceContextMax"=dword:00000006
"DhcpIPAddress"="218.19.66.142" //此为Internet本机IP
"DhcpSubnetMask"="255.255.255.0"
你用API函数,读取DhcpIPAddress的值就可以了。
这。NdisWan7是设备名,如adsl,isdn等。
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\NdisWan7\Parameters\Tcpip]
"EnableDHCP"=dword:00000000
"UseZeroBroadcast"=dword:00000000
"LLInterface"="\\Device\\RASARP"
"IPAddress"=hex(7):30,2e,30,2e,30,2e,30,00,00
"SubnetMask"=hex(7):30,2e,30,2e,30,2e,30,00,00
"DefaultGateway"=hex(7):00
"MTU"=dword:00000578
"IPInterfaceContext"=dword:00000006
"IPInterfaceContextMax"=dword:00000006
"DhcpIPAddress"="218.19.66.142" //此为Internet本机IP
"DhcpSubnetMask"="255.255.255.0"
你用API函数,读取DhcpIPAddress的值就可以了。
解决方案 »
- 有人用过leadtools13编程吗?如果判断图像的大小是A3还是A2幅面的?
- WORD文档中如何区分汉字和英文!我的意图是要删除汉字,保留英文!ths
- 读二进制文件
- 求教!急!!!
- a
- 高分求救这样的问题怎么解决100(急!!)
- NetServerEnum and NetServerGetInfo ?
- vb程序打包后,在安装过程中出现下面错误信息c:\windows\st6unst.exe复制文件发生访问冲突
- 懒人提问,把 Access 中的数据库一次插入到SQL数据库中~~~!
- 用VB如何建立全屏的程序(要求WINDOWS的任务栏不能出现)?
- 为什么用vb打包程序打的包,有些控件必须防在winsys(win2000 在winnt\system32 下)
- 请教高手,如何用实现ListView的图表问题!!
这。NdisWan7是设备名,如adsl,isdn等。
[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\NdisWan7\Parameters\Tcpip]
"EnableDHCP"=dword:00000000
"UseZeroBroadcast"=dword:00000000
"LLInterface"="\\Device\\RASARP"
"IPAddress"=hex(7):30,2e,30,2e,30,2e,30,00,00
"SubnetMask"=hex(7):30,2e,30,2e,30,2e,30,00,00
"DefaultGateway"=hex(7):00
"MTU"=dword:00000578
"IPInterfaceContext"=dword:00000006
"IPInterfaceContextMax"=dword:00000006
"DhcpIPAddress"="218.19.66.142" //此为Internet本机IP
"DhcpSubnetMask"="255.255.255.0"
你用API函数,读取DhcpIPAddress的值就可以了。
dim sHostName as string*256
dim lpHost as long
dim Host as HOSTENT
dim dwIPAddr as long
dim tmpIPAddr() as Byte
dim i as integer
dim sIPAddr as stringif not sockersInitialize() then
GetIPAddress=""
exit function
end ifif gethostname(sHostName,256)=socket_error then
getipaddress=""
msgbox "Windows Sockets error"
SocketsCleanup
exit function
end ifsHostName=trim$(sHostName)
lpHost=gethostbyname(sHostName)
if lpHost=0 then
getipaddress=""
msgbox "windows sockets are not responding"
socketsCleanup
exit function
end ifcopymemory host,lphost,len(host)
copymemory dwipaddr,host.haddlist,4
redim tmpipaddr(1 to host.hlen)
copymemory tmpipaddr(1),dwipaddr,host.hlen
for i=1 to host.hlen
sipaddr=sipaddr & tmpipaddr(i) & "."
next
getipaddress=mid$(sipaddr,1,len(sipaddr)-1)
socketsCleanup
end function
还有其它方法吗?
请再将以下几个函数的内容贴出来,谢谢。
sockersInitialize()
gethostname(sHostName,256)
gethostbyname(sHostName)
socketsCleanup()
为什么我查找整个注册表里也没有DhcpIPAddress这个键呢.我用的2000,请问是什么原因.