如何获得局域网中所以计算机名,及IP地址
如题?
哪位大哥能说下,最好能具本一点.
[解决办法]
结题给分率低了点,还是做件好事吧,哈哈,好人有好报!
.h文件
//---------------------------------------#ifndef Unit1H#define Unit1H//---------------------------------------#include <Classes.hpp>#include <Controls.hpp>#include <StdCtrls.hpp>#include <Forms.hpp>//---------------------------------------class TForm1 : public TForm{__published: // IDE-managed Components TButton *Button1; TMemo *Memo1; void __fastcall Button1Click(TObject *Sender);private: // User declarations String __fastcall GetMyHost(); AnsiString __fastcall gethostip(AnsiString & host); bool __fastcall EnumNetResource(TStrings *rcList,LPNETRESOURCE lpNR, DWORD dwScope,DWORD dwType); void __fastcall ScanNetComputer();public: // User declarations __fastcall TForm1(TComponent* Owner);};//---------------------------------------extern PACKAGE TForm1 *Form1;//---------------------------------------#endif