hi,
i want to open a text file(notepad) with using process command .
thank you.
How to open .txt file with out using system.diagnostics.process
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Scott Knake30 pointsPosted Jul 21, 2009, 3:41 AM EDT
[System.Runtime.InteropServices.DllImport("shell32.dll")]
private static extern long ShellExecute(Int32 hWnd, string lpOperation,
string lpFile, string lpParameters, string lpDirectory, long nShowCmd);
private enum SW
{
SW_HIDE = 0,
SW_SHOWNORMAL = 1
}
private void OpenNotepad()
{
ShellExecute(0, "open", "notepad.exe", null, null, (long)SW.SW_SHOWNORMAL);
}