文件读出(C++):
FILE *fp_read;
char readData[ SI_CMD::WRITE_FILE::MAX_LINE_LENGTH];
int result = fopen_s(&fp_read,SI_CMD::WRITE_FILE::HEX_FILE, "r" );
if(result != 0)
{
throw;
}
while(fgets(readData,SI_CMD::WRITE_FILE::MAX_LINE_LENGTH, fp_read)!=NULL)
{
String^ str = gcnew System::String(readData);
this->textBox1->AppendText(str);
}
fclose(fp_read);
文件写入:(C#)
array<String^>^ writeArray = gcnew array<String^>(this->textBox1->Lines->Length );
writeArray = this->textBox1->Lines;
System::IO::File::WriteAllLines(saveFileName,writeArray);