How to open a text file in notepad?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vijendra singh

    How to open a text file in notepad?

    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?
  • hype261
    New Member
    • Apr 2010
    • 207

    #2
    Here is a link to do a knowledge base on how to do basic IO in C#.

    Comment

    • GaryTexmo
      Recognized Expert Top Contributor
      • Jul 2009
      • 1501

      #3
      To open a file in notepad, you'll actually need to launch the notepad process with a command line option pointing to your file.

      Code:
      Process p = new Process();
      ProcessStartInfo startInfo = new ProcessStartInfo("notepad.exe", theFileName);
      p.StartInfo = startInfo;
      p.Start();

      Comment

      Working...