How to open Notepad from a Windows Forms application and place some text in it?

前端 未结 3 1908
抹茶落季
抹茶落季 2021-01-06 03:07

I\'m using VB.NET and Visual Studio 2008.

My question is: How do I open Notepad from a Windows Forms application, and then place some text string in the Notepad wind

3条回答
  •  醉梦人生
    2021-01-06 03:16

    The trick here is to make a text file, and pass it to Notepad as a command line argument, or, if Notepad is the default application for ".txt", you can shell straight to the filename.

    Creating/editing textfile through VB.NET

    Launch and watch a process from VB.NET 2010

    You can use the arguments collection ProcessStartInfo to pass the filename if required.

提交回复
热议问题