|
|
导航: |
论坛 -> DELPHI技术
斑竹:liumazi,sephil |
|
作者: |
|
2004/2/25 9:37:27 |
标题: |
请问怎么样获得一个系统使用者的IP?我想做一个用户操作日志,。。在线等,谢谢 |
浏览:1084 |
|
加入我的收藏 |
楼主: |
请问怎么样获得一个系统使用者的IP?我想做一个用户操作日志,。。在线等,谢谢
----------------------------------------------
zhaohuijun |
作者: |
bios (阿贡) |
★☆☆☆☆ |
-
|
盒子中级会员 |
|
2004/2/25 11:29:09 |
1楼: |
String LocalIP() { PInAddr ptr[11] ; PInAddr *pptr= ptr; PHostEnt phe ; char Buffer[63]; int i; WSAData GInitData ; String ret;
WSAStartup(0x101, &GInitData); gethostname(Buffer, sizeof(Buffer)); phe=gethostbyname(Buffer); if (phe ==NULL) return ""; pptr = (PInAddr *)(phe->h_addr_list); i= 0; while (pptr[i]!=NULL) { ret=inet_ntoa(*pptr[i]); i++; } WSACleanup; return ret; }
----------------------------------------------
|
作者: |
|
2004/2/27 13:26:23 |
2楼: |
谢谢bios兄弟。。
在Delphi的一个窗体里加一段什么样的程序啊〉?我用Dephi做。。。
----------------------------------------------
zhaohuijun
|
|