TextBox File Open
-
0
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? Will someone please read this question and answer it. I see that some questions get numerous answers and I can't even get one answer. Please help me!
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(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(myOutfileTextString);
} -
0
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? Will someone please read this question and answer it. I see that some questions get numerous answers and I can't even get one answer. Please help me!
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(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(myOutfileTextString);
}