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
Manas MohapatraPosted Aug 12, 2016, 1:51 AM
Manoj MaharanaPosted Aug 11, 2016, 11:03 AM
Server Error in '/' Application.
Access is denied
Tapan PatelPosted Aug 11, 2016, 10:56 AM
Manoj MaharanaPosted Aug 11, 2016, 10:53 AM
Tapan PatelPosted Aug 11, 2016, 10:47 AM
Manoj MaharanaPosted Aug 11, 2016, 10:43 AM
Tapan PatelPosted Aug 11, 2016, 10:39 AM
Manoj MaharanaPosted Aug 11, 2016, 9:30 AM
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:
Tapan PatelPosted Aug 11, 2016, 9:25 AM
Manoj MaharanaPosted Aug 11, 2016, 9:20 AM
Tapan PatelPosted Aug 11, 2016, 9:10 AM
Manoj MaharanaPosted Aug 11, 2016, 9:08 AM
Tapan PatelPosted Aug 11, 2016, 8:53 AM