Hello.
How to convert System String to string or fstream ? What an idea. Open an open file with a file for reading ... And everything that opened is placed in fstream. The problem with placing in fstream.
fstream myStream; string str; if(openFileDialog1->ShowDialog() == System::Windows::Forms::DialogResult::OK) { System::IO::StreamReader ^ sr = gcnew System::IO::StreamReader(openFileDialog1->FileName); MessageBox::Show(sr->ReadLine()); myStream=sr; sr->Close(); }
stdstreams, the concepts of binary and text streams, as well as readers / writers, are mixed. In the .NET class, Stream is a binary stream that allows reading / writing of bytes, and readers / writers, for example, TextReader, XmlReader (and corresponding writers), are used to read / write text and any other content. - AlexeyM