http://expert.csdn.net/Expert/topic/817/817759.xml?temp=8.111209E-02
解决方案 »
- 请问按月分类统计的累加SQL语句怎么写
- 三层应用如何部署?
- 请教高手
- Excel表格数据导入数据库的问题
- rainstormmaster兄、James0001兄、supergreenbean兄、 subzero兄、TechnoFantasy兄,请看过来
- ActiveX控件中的WEBBROWSER控件编辑WORD文档时可否不在客户端生成临时文件?
- 为什么设计时控件的属性不可以修改?在线等候
- 如何看懂VB对象浏览器?
- 怎样在程序中实现点一个键便能显示桌面,就像点快速启动中的那个程序一样,可惜无法用shell函数来调用它.
- 谁知道split("userdb10,liyougui,liyougui,e:\cxwnew,,pulldb1",",",-1)写法是否正确?返回值是什么?
- 怎么解决VB的打包问题!
- 各位,我没有办法了,请帮忙!!!!!!!帮我看一看这几句!!!!!!!
www.allapi.com
Public Function GetIPAddress() As String
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 String
If gethostname(sHostName, 256) <> 0 Then
GetIPAddress = ""
MsgBox " 取本机IP地址出错!", vbInformation + vbOKCancel, "严重错误"
Exit Function
End If
sHostName = Trim(sHostName)
lpHost = gethostbyname(sHostName)
If lpHost = 0 Then
GetIPAddress = ""
MsgBox "Windows Sockets are not responding. " & "Unable to successfully get Host Name."
Exit Function
End If
CopyMemoryIP HOST, lpHost, Len(HOST)
CopyMemoryIP dwIPAddr, HOST.hAddrList, 4
ReDim tmpIPAddr(1 To HOST.hLen)
CopyMemoryIP tmpIPAddr(1), dwIPAddr, HOST.hLen
For i = 1 To HOST.hLen
sIPAddr = sIPAddr & tmpIPAddr(i) & "."
Next
GetIPAddress = Mid$(sIPAddr, 1, Len(sIPAddr) - 1)
End Function