Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

open (print)a text file to the screen

0 views
Skip to first unread message

Allen

unread,
Dec 19, 2009, 1:16:31 PM12/19/09
to

Can anybody tell me how to open (print)a text file to the screen. For
example, to click a botton and the file will be shown in the screen. Using
something like the code below.(the code below is not good, but I want to
give you an idea)

private: System::Void ShwCrdBtn_Click(System::Object^ sender,
System::EventArgs^ e)

{
FileInfo^ fi = gcnew FileInfo("C:\\MyFile.txt");
fi->OpenRead();

}

--
Thanks
Allen

Family Tree Mike

unread,
Dec 20, 2009, 12:00:05 AM12/20/09
to

You'll need to do the translation to C++, but in C#, I think you want:

string txt = File.ReadAllText(@"c:\myfile.txt");
MessageBox.Show(txt);

--
Mike

0 new messages