By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,759 Members | 1,727 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,759 IT Pros & Developers. It's quick & easy.

How to open a text file in notepad?

P: n/a
I have created a notepad in c#.
Now i want to open a text file in my notepad. but i dont know how to do that, can anybody help me?
Oct 1 '10 #1
Share this Question
Share on Google+
2 Replies

P: 207
Here is a link to do a knowledge base on how to do basic IO in C#.
Oct 1 '10 #2

Expert 100+
P: 1,501
To open a file in notepad, you'll actually need to launch the notepad process with a command line option pointing to your file.

Expand|Select|Wrap|Line Numbers
  1. Process p = new Process();
  2. ProcessStartInfo startInfo = new ProcessStartInfo("notepad.exe", theFileName);
  3. p.StartInfo = startInfo;
  4. p.Start();
Oct 1 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.