Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
  2. Stream^ myStream;
  3. openFileDialog1->Filter = "Текстовые файлы (*.txt)|*.txt|Все файлы (*.*)|*.*";
  4.  
  5. if (openFileDialog1->ShowDialog() == System::Windows::Forms::DialogResult::OK)
  6. {
  7. label1->Text = openFileDialog1->FileName;
  8. if ( (myStream = openFileDialog1->OpenFile()) != nullptr )
  9. {
  10. // Insert code to read the stream here.
  11. myStream->Close();
  12. textbox1->text=Convert::ToString(myStream);
  13.  
  14. }
  15.  
  16. }
  17.  
  18. }
  19.  
  20. textBox1->Text = System::IO::File::ReadAllText(openFileDialog1->FileName);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement