Click here to Skip to main content
15,921,250 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hii everyone,i'm beginner

How to open file notepad to show changes i do after insert data to it by windows form.
Posted

Assuming that the file you wrote the data to is a straight text file, with the extension "TXT"
C#
Process.Start(pathToTheActualFileFullName);
If not, that will open it in whatever program is registered for it's extension - which may be notepad, but may not be.
If you absolutely want to open notepad:
C#
Process.Start("Notepad.exe", pathToTheActualFileFullName);
 
Share this answer
 
hi u can use:
C#
var fileToOpen = "SomeFilePathHere";
var process = new Process();
process.StartInfo = new ProcessStartInfo()
{
    UseShellExecute = true,
    FileName = fileToOpen
};

process.Start();
process.WaitForExit(

);


or

System.Diagnostics.Process.Start( "notepad.exe", "text.txt");
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900