我没有网卡,winsock1.localip = 拨号上网的动态 ip 。
解决方案 »
- 在dos下,或者windows2000/xp下的命令行窗口下将变量增加或减少的方法?
- 高手请帮看下面这两句什么作用?分不是很多了!谢谢
- help -----程序調試過程出現内存不能read
- 关于控制台的问题
- VB Script高手快快请教!
- VB中在textbox中查找单个的字符或字符串有什么好方法?
- 如何从sql server中读取doc和jpg文件
- 1000分求救!!我的重 要的数据全部没有了!有没有这样的软件让它恢复!!!!!
- 正在作个考试系统,如何能把access2000中的用ole保存的题目字段中word文档在word中进行排版,组卷???又没有原程序,请发给我!!谢谢
- 哪里有比较全面的关于datagrid的示例程序?
- 如何得到当前应用程序的父路径?急!!!
- 打印机支持的纸张!
好象分太少了:(
Public Declare Function gethostbyname Lib "WSOCK32.DLL" _
(ByVal szHost As String) As Long
Public Declare Sub RtlMoveMemory Lib "kernel32" _
(hpvDest As Any, _
ByVal hpvSource As Long, _
ByVal cbCopy As Long)Private Function GetMyIP() As String
Dim hostname As String * 256
Dim hostent_addr As Long
Dim host As HOSTENT
Dim hostip_addr As Long
Dim temp_ip_address() As Byte
Dim I As Integer
Dim ip_address As String
ReDim MyIP(4)
If gethostname(hostname, 256) = SOCKET_ERROR Then
MsgBox "Windows Sockets error " & Str(WSAGetLastError())
Else
hostname = Trim$(hostname)
End If
hostent_addr = gethostbyname(hostname)
If hostent_addr = 0 Then
MsgBox "Winsock.dll is not responding."
End If
RtlMoveMemory host, hostent_addr, LenB(host)
RtlMoveMemory hostip_addr, host.hAddrList, 4
ReDim temp_ip_address(1 To host.hLen)
RtlMoveMemory temp_ip_address(1), hostip_addr, host.hLen
For I = 1 To host.hLen
ip_address = ip_address & temp_ip_address(I) & "."
MyIP(I) = temp_ip_address(I)
Next
ip_address = Mid$(ip_address, 1, Len(ip_address) - 1)
GetMyIP = ip_address
End Function
不会得动态IP,去看看http://go3.163.com/_NTES/~delphi6/doc/internet/tel_ip.htm