不知道怎么回到文件开头
在 C++ 中,我可以关闭然后再次打开文件。
但是没有“read_file->Open()”
StreamReader^ read_file = gcnew StreamReader(path + "\\" + file);
//CODE
read_file->Close();
//And now what to open it again or go to begining?
我没有尝试任何东西,因为我只是不知道。
只需创建一个新的
StreamReader
,即
auto read_file = gcnew StreamReader(path + "\\" + file);
auto line = read_file->ReadLine();
read_file->Close();
//re-open
read_file = gcnew StreamReader(path + "\\" + file);