public static void ShowMessage(DataTable message = null, string title = null)
{
Process notepad = Process.Start(new ProcessStartInfo("notepad.exe"));
// Process notepad = System.Diagnostics.Process.Start(new ProcessStartInfo("notepad.exe", "txt_notes.Text"));
// Process notepad = System.Diagnostics.Process.Start(new ProcessStartInfo("notepad.exe", Environment.GetEnvironmentVariable("windir")));
// Process notepad = System.Diagnostics.Process.Start(new ProcessStartInfo("notepad.exe", "txt_notes.Text"));
//Process notepad = Process.Start(new ProcessStartInfo(@"c:\myfile.txt"));
notepad.WaitForInputIdle();
if (!string.IsNullOrEmpty(title))
SetWindowText(notepad.MainWindowHandle, title);
if (notepad != null)
{
if (message.Rows.Count > 0)
{
StringBuilder sb = new StringBuilder();
sb.Append("Notes : ");
sb.Append(message.Rows[0]["Notes"].ToString());
sb.Append(Environment.NewLine);
sb.Append(Environment.NewLine);
sb.Append("Title : ");
sb.Append(message.Rows[0]["Title"].ToString());
Literal lt = new Literal();
lt.Text = sb.ToString();
IntPtr child = FindWindowEx(notepad.MainWindowHandle, new IntPtr(0), "Edit", null);
SendMessage(child, 0x000C, 0, lt.Text);
}
}
}
The problem is that it is not working on server...
i want to show text file in notepad.
error comes

Tapan PatelRank #614 · 3.9K reputationPosted Aug 11, 2016, 6:47 AM EDT
Manoj MaharanaRank #4,500 · 340 reputationPosted Aug 11, 2016, 6:53 AM EDT
Tapan PatelRank #614 · 3.9K reputationPosted Aug 11, 2016, 4:53 AM EDT
Manoj MaharanaRank #4,500 · 340 reputationPosted Aug 11, 2016, 5:08 AM EDT
Tapan PatelRank #614 · 3.9K reputationPosted Aug 11, 2016, 5:10 AM EDT
Manoj MaharanaRank #4,500 · 340 reputationPosted Aug 11, 2016, 5:20 AM EDT
Tapan PatelRank #614 · 3.9K reputationPosted Aug 11, 2016, 5:25 AM EDT
Manoj MaharanaRank #4,500 · 340 reputationPosted Aug 11, 2016, 5:30 AM EDT
Server Error in '/' Application.
Access is denied
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.ComponentModel.Win32Exception: Access is denied
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.Stack Trace:
[Win32Exception (0x80004005): Access is denied] System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo) +773 System.Diagnostics.Process.Start() +123 System.Diagnostics.Process.Start(ProcessStartInfo startInfo) +49 ksoftweb.Control.FTPAddEdit.ShowMessage(DataTable message, String title) +63 ksoftweb.Control.FTPAddEdit.btnexnotpade_Click(Object sender, EventArgs e) +907 System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e) +116 System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) +101 System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +9665050 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724Tapan PatelRank #614 · 3.9K reputationPosted Aug 11, 2016, 6:39 AM EDT
Manoj MaharanaRank #4,500 · 340 reputationPosted Aug 11, 2016, 6:43 AM EDT
Tapan PatelRank #614 · 3.9K reputationPosted Aug 11, 2016, 6:56 AM EDT
Manoj MaharanaRank #4,500 · 340 reputationPosted Aug 11, 2016, 7:03 AM EDT
Server Error in '/' Application.
Access is denied
Manas MohapatraRank #182 · 13.2K reputationPosted Aug 11, 2016, 9:51 PM EDT