è piuttosto semplice
codice:void __fastcall TForm1::Button1Click(TObject *Sender) { FILE *fp; char mybuf[256]; fp = fopen("test.txt","r"); if( ClientSocket1->Active ) ClientSocket1->Socket->SendText("INIZIOTESTO,"); while ( fgets(mybuf,sizeof(mybuf),fp) != NULL) { if( ClientSocket1->Active ) ClientSocket1->Socket->SendBuf(mybuf,strlen(mybuf)); } fclose(fp); if( ClientSocket1->Active ) ClientSocket1->Socket->SendText(",FINETESTO;"); ClientSocket1->Close(); }