声明win32 API函数: function int WSAStartup( uint UIVersionRequested, ref s_WSAData lpWSAData ) library "wsock32.dll" function int WSACleanup() library "wsock32.dll" function int WSAGetLastError ( ) library "wsock32.dll" function int gethostname ( ref string name, int namelen ) library "wsock32.dll" function string GetHost(string lpszhost, ref blob lpszaddress ) library "pbws32.dll" 使用方法: s_wsadata l_WSAData string ls_HostName = space(128) string ls_IpAddress int li_version = 257 blob{4} lb_hostaddress IF wsastartup ( li_version, l_WSAData ) = 0 THEN IF gethostname ( ls_HostName, len(ls_HostName) ) < 0 THEN messagebox("GetHostName",WSAGetLastError()) ELSE GetH |
07-07
05-13