TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Manoj Maharana
NA
362
127.6k
Notepad in C# (txt file)
Aug 11 2016 8:45 AM
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
Server Error in '/' Application.
Access is denied
Reply
Answers (
13
)
find the word and replace it with ascending number in xml
replace same words in a string with different words