************************************/ client->setCommand(\ client->sendCommand(); client->receiveCommand(); client->getPort(); client->setCommand(\ client->sendCommand(); client->receiveCommand(); client->interlizeDataSocket(); cout<<\ cin>>filename; client->setCommand(\ client->sendCommand(); client->receiveCommand(); client->sendData(filename); client->receiveCommand(); delete filename; }
else if(strcmp(Command,\{ char* filename = new char[512]; memset(filename,NULL,strlen(filename)); cout<<\ cin>>filename; client->setCommand(\ client->sendCommand(); client->receiveCommand(); delete filename; }
else if(strcmp(Command,\{ memset(Direct,NULL,strlen(Direct)); cout<<\ cin>>Direct; client->setCommand(\ client->sendCommand(); client->receiveCommand(); }
else if(strcmp(Command,\{ memset(Direct,NULL,strlen(Direct)); cout<<\ cin>>Direct; client->setCommand(\
36 / 37
}
}
}
client->sendCommand(); client->receiveCommand(); }
else if(strcmp(Command,\{ break; } else { cout<<\}
} else cout<<\cout<<\//清理内存
delete userName; delete Direct; delete client;
cout<<\system(\
实验心得体会
1. 实验一与实验二在本机上直接输入命令行进行操作不可行,需要使用管理员命令权限。
即用vs2010编译成功后,用管理员权限运行命令行程序,再运行编译完成的.exe文件。 2. 实验三在首次运行是报出内存异常的问题,在百度后,猜测为vs2010某个动态链接库
不匹配造成。于是使用兼容模式运行,运行成功。
3. 了解代码注释的编写很重要,能防止编写者遗忘先前的想法。
37 / 37