20.12.2010, 12:31
Pessaol eu fiz isso aqui e ele pensa que й uma array
isso й para o meu programa que controla o Server por fora. a funcionalidade sу eu sei?mas preciso que ele leia o arquivo .com e responda com o arquivo .resp, o meu programa irб passar o comando pelo arquivo .com e o fs ira responder com o arquivo .resp!

Код:
public CheckConnectionWithTool(tentativas)
{
for(new i=0; i<tentativas; i++)
{
new string[256]; // Create the string to store the read text in
new File: file = fopen("sampsc/socket.com", io_read); // Open the file
if (file)
{
// Le o Comando
fread(file, string); // Fread from the file and store what's read in 'string'
fclose(file); // Close the file
new command[256];
format(command, sizeof(command),"%s",string);
if (command == "CHECKSTATUS")
{
// Envia o Status da COM
new strfile[256];
format(strfile, sizeof(strfile),"SDKOK_RESP001");
new File: file2 = fopen("sampsc/socket.resp", io_write); // Open the file
if (file2)
{
fremove("sampsc/socket.resp");
}
fwrite(file2, strfile);
fclose(file2);
}
}
return 1;
}
return 0;
}

