????Ping??????????????????????IP???????????IP?????????32??????????????????????????????????任??£????·??????????????????????Щ??????????????????????C++ Builder NetMaster?е?NMEcho?????????????????????
?????????????????
????????Edit????????????????????????IP??????????????????????????????????????????????????????
????????RichEdit?????????????????????????????????????????????????????????
????????CheckBox???????????????????趨?????
???????Button???????????в????
???????StatusBar??????????????ó????????
??????????????????£?
void __fastcall TForm1::Button1Click(TObject ender)
{ //????NMEcho???????TCP/IP????
NMEcho1-??Host=Edit1-??Text ;
NMEcho1-??TimeOut=StrToInt(Edit2-??Text) ;
if(CheckBox1-??Checked)
NMEcho1-??Port=StrToInt(Edit3-??Text);
else
NMEcho1-??Port=7;
//TCP/IP??Echo????????
NMEcho1-??ReportLevel=Status_Basic;
NMEcho1-??Connect(); //????????
RichEdit2-??Clear ();
for(int i=0;i
//RichEdit1???????????????????
RichEdit2-??Text=RichEdit2-??Text +NMEcho1-??Echo(RichEdit1-??Lines-??
Strings[i]);
NMEcho1-??Disconnect ();
}
???????:?????NMEcho?????Connect?????????????????????????????????????????
??????????Connect?????????????????????????????????IP???????????????????????????????????????????????OnHostResoved?????????????????У?????????????????????????????????????????????????£?
void __fastcall TForm1::NMEcho1HostResolved(TComponent ??ender)
{
StatusBar1-??Panels-??Items[0]-??Text="Host Resolved!";
}
????????????????????????????????????????OnInvalidHost?????????????????У?????????????????????????????????IP?????????????????????????????????????????????£?
void __fastcall TForm1::NMEcho1InvalidHost(bool &&Handled)
{
AnsiString s;
if(InputQuery("Invailid host!"??"Specify a new host:"??s))
{
NMEcho1-??Host=s;
Handled=true;
}
}