//---------------------------------------------------------------------------
#include
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ServerSocket1ClientDisconnect(TObject *Sender,
TCustomWinSocket *Socket)
{
:I=ListView1->Items->IndexOf(Socket->RemoteAddress);
: ListView1->Items->Delete(I);
}
//---------------------------------------------------------------------------
int __fastcall GetListViewIndexOf(TListView *lstV,String sCaption)
{
if(lstV==NULL)return 0;
for(int idx=0;idxItems->Count;idx++)
{
if(lstV->Items->Item[i]->Caption==sCaption)return idx;
}
return 0 ;
}
///------------------------------------------------------------------------
void __fastcall TForm1::ServerSocket1ClientConnect(TObject *Sender,
TCustomWinSocket *Socket)
{
TListItem *item = ListView1->Items->Add();
item->Caption=Socket->RemoteAddress;
}
//---------------------------------------------------------------------------
이렇게했는데; 흠,,,
|