TextBox String to open file

49 Views Asked by At

I need to read the TextBox input, my username and password work as below, but the file input and file output require another step to convert a string that can open the files.

I've tried every example I can find, cstring numerous times.I can't believe no one uses a textbox to open a file. Why can't i get an answer?

THESE 2 BELOW WORK private: System::Void usernameTextBox_TextChanged(System::Object^ sender, System::EventArgs^ e) { msclr::interop::marshal_context context; std::string myUsername = context.marshal_asstd::string(usernameTextString); }

private: System::Void passwordTextBox_TextChanged(System::Object^  sender, System::EventArgs^  e) {
     msclr::interop::marshal_context context;
     std::string myPassword = context.marshal_as<std::string>(passwordTextString);
     }

THESE 2 BELOW NEED AN ADDITIONAL LINE OF CODE TO OPEN THE FILES private: System::Void myInfileTextBox_TextChanged(System::Object^ sender, System::EventArgs^ e) { msclr::interop::marshal_context context; std::string myInfile = context.marshal_asstd::string(myInfileTextString); }

private: System::Void myOutfileTextBox_TextChanged(System::Object^  sender, System::EventArgs^  e) {
     msclr::interop::marshal_context context;
     std::string myOutfile = context.marshal_as<std::string>(myOutfileTextString);
     }
0

There are 0 best solutions below