Hi - I'm trying to get the filename and path of a file I'm opening with the OpenFileDialog in Visual C++. I can open and display the contents of the file OK, but I'm having problems accessing the filename and path, I guess they're stored in a structure somewhere? Code so far below...Thanks in advance!
private: System::Void button1_Click(System::Object * sender, System::EventArgs * e)
{
if(openFileDialog1->ShowDialog() == DialogResult::OK)
{
String* get_FileNames();
System::IO::StreamReader * sr = new
System::IO::StreamReader(openFileDialog1->FileName);
MessageBox::Show(sr->ReadToEnd());
sr->Close();
}
}