Click here to Skip to main content
15,903,362 members
Home / Discussions / C#
   

C#

 
Generalassembly not found Pin
infi_20078-Jan-08 0:50
infi_20078-Jan-08 0:50 
GeneralRe: assembly not found Pin
Mircea Puiu8-Jan-08 1:07
Mircea Puiu8-Jan-08 1:07 
GeneralWindows Permission Dialog Pin
borjolujo8-Jan-08 0:29
borjolujo8-Jan-08 0:29 
QuestionCrystal Reports CrossTab fields Pin
adi.rusu8-Jan-08 0:03
adi.rusu8-Jan-08 0:03 
QuestionHow to call notepad from windows service Pin
ravindradonkada7-Jan-08 23:56
ravindradonkada7-Jan-08 23:56 
GeneralRe: How to call notepad from windows service Pin
sindhutiwari8-Jan-08 1:17
sindhutiwari8-Jan-08 1:17 
GeneralRe: How to call notepad from windows service Pin
Vasudevan Deepak Kumar8-Jan-08 2:31
Vasudevan Deepak Kumar8-Jan-08 2:31 
QuestionHow to open notepad from windows service Pin
ravindradonkada7-Jan-08 23:55
ravindradonkada7-Jan-08 23:55 
Hi ,
This is ravindra,currently working on Windows Service.
I implemented the following two methods to call notepad.exe from windows
service,but its not working.So,please anybody help to complete my task.

Method1:
=======

STARTUPINFO si = new STARTUPINFO();

PROCESS_INFORMATION pi = new

PROCESS_INFORMATION();



CreateProcess("C:\\WINDOWS\\SYSTEM32\\notepad.exe", null,

IntPtr.Zero, IntPtr.Zero, false, 0, IntPtr.Zero, null,

ref si, out pi);

EventLog.WriteEntry("After notepad");

}

[DllImport("kernel32.dll")]

static extern bool CreateProcess(string lpApplicationName, string
lpCommandLine,
IntPtr lpProcessAttributes, IntPtr lpThreadAttributes, bool
bInheritHandles, uint
dwCreationFlags, IntPtr lpEnvironment, string lpCurrentDirectory, ref
STARTUPINFO
lpStartupInfo, out PROCESS_INFORMATION lpProcessInformation);

}

}


Method2:
========

EventLog.WriteEntry("In the notepad");

ProcessStartInfo psi = new ProcessStartInfo();

psi.FileName = "notepad.exe";

psi.UseShellExecute = false;

psi.Domain = "sys43.";

psi.UserName = "Acer OEM User";

SecureString secure = new SecureString();

string password = "nopassword";

foreach (char c in password)

{ secure.AppendChar(c); }

psi.Password = secure;

Process process = new Process();

process.StartInfo = psi;

process.Start();
GeneralStarting NotePad from C# code Pin
Mircea Puiu8-Jan-08 0:57
Mircea Puiu8-Jan-08 0:57 
GeneralRe: Starting NotePad from C# code Pin
Stu Richardson8-Jan-08 1:18
Stu Richardson8-Jan-08 1:18 
GeneralRe: Starting NotePad from C# code Pin
Mircea Puiu8-Jan-08 1:20
Mircea Puiu8-Jan-08 1:20 
GeneralRe: Starting NotePad from C# code Pin
J4amieC8-Jan-08 1:23
J4amieC8-Jan-08 1:23 
GeneralRe: Starting NotePad from C# code Pin
Mircea Puiu8-Jan-08 1:25
Mircea Puiu8-Jan-08 1:25 
GeneralRe: How to open notepad from windows service Pin
J4amieC8-Jan-08 1:25
J4amieC8-Jan-08 1:25 
GeneralRe: How to open notepad from windows service Pin
Stu Richardson8-Jan-08 1:54
Stu Richardson8-Jan-08 1:54 
GeneralRe: How to open notepad from windows service Pin
Mircea Puiu8-Jan-08 1:48
Mircea Puiu8-Jan-08 1:48 
QuestionHow to set SerialPort settings Pin
gruberdominik7-Jan-08 23:37
gruberdominik7-Jan-08 23:37 
AnswerRe: How to set SerialPort settings Pin
Luc Pattyn8-Jan-08 3:38
sitebuilderLuc Pattyn8-Jan-08 3:38 
QuestiondataGridView (please i need urgently) [modified] Pin
usyra427-Jan-08 22:45
usyra427-Jan-08 22:45 
GeneralRe: dataGridView (please i need urgently) Pin
Mircea Puiu8-Jan-08 1:14
Mircea Puiu8-Jan-08 1:14 
GeneralP/Invokes into native code Pin
N a v a n e e t h7-Jan-08 22:12
N a v a n e e t h7-Jan-08 22:12 
GeneralRe: P/Invokes into native code Pin
Giorgi Dalakishvili7-Jan-08 23:48
mentorGiorgi Dalakishvili7-Jan-08 23:48 
GeneralRe: P/Invokes into native code Pin
N a v a n e e t h8-Jan-08 2:30
N a v a n e e t h8-Jan-08 2:30 
GeneralMouse and keyboard logger Pin
sepel7-Jan-08 22:09
sepel7-Jan-08 22:09 
GeneralRe: Mouse and keyboard logger Pin
Christian Graus7-Jan-08 22:13
protectorChristian Graus7-Jan-08 22:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.