#include
WNetOpenEnum (dwScope, NULL, NULL, NULL, & hEnum); WSAStartup (MAKEWORD (1,1), & wsaData); if (hEnum) {DWORD Count = 0xFFFFFFFF; DWORD BufferSize = 2048; LPVOID Buffer = new char [2048]; WNetEnumResource (hEnum, & Count, Buffer, & BufferSize); netResource = (NETRESOURCE *) Buffer; char szHostName [200]; unsigned int i; for (i = 0; i
if (netResource-> lpRemoteName) {String strFullName = netResource-> lpRemoteName; if (strFullName.Pos ( "") == 1) strFullName = strFullName.SubString (3, strFullName.Length () - 2);
Gethostname (SzhostName); Host = gethostByName (StrfullName.c_STR ());
IF (Host == NULL) Continue;
Ptr = (struct in_addr *) Host-> h_addr_list [0];
A = PTR-> S_un.s_un_b.s_b1; // 172 b = Ptr-> S_un.s_un_b.s_b2; // 22 c = Ptr-> S_un.s_un_b.s_b3; // 106 d = Ptr-> S_un.s_un_b .s_b4; //213strings->add (Format("%d.%D.%D.%D ", ORAYOFCONST ((a ,b ,c, sm))));}}
Delete buffer; wnetcloseenum (henum);
Washnup (); return (strings-> count> Origincount);} // --------------------------------- ------------------------------------------