B
Bo
In my asp.net webservice application, I need to launch a DOS process
as authorized users. To impersonate users, I use <impersonation =
true> in my webconfig. I can't use Diagnostics.Process.Start, because
it creates a child process using parent process token "System", not
the impersonated thread token. I don't want to use
CreateProcessWithLogonW, because my application impersonates different
users and it is not a good idea to handle passwords. So I am using
CreateProcessAsUser to handle it. Since I can't find any C# examples
with CreateProcessAsUser, I spent hours to figure it out.
Now CreateProcessAsUser is working for me, I don't know how to read
standard output and error from the child process. There is a help page
"Creating a Child Process with Redirected Input and Output" for C++.
Since I don't know much about C++, can someone create a C# sample code
from it?
Once I have a working sample that can create child process as
impersonated user and redirect standard output and error, I will post
it in the newsgroups. Many people can benefit from it.
as authorized users. To impersonate users, I use <impersonation =
true> in my webconfig. I can't use Diagnostics.Process.Start, because
it creates a child process using parent process token "System", not
the impersonated thread token. I don't want to use
CreateProcessWithLogonW, because my application impersonates different
users and it is not a good idea to handle passwords. So I am using
CreateProcessAsUser to handle it. Since I can't find any C# examples
with CreateProcessAsUser, I spent hours to figure it out.
Now CreateProcessAsUser is working for me, I don't know how to read
standard output and error from the child process. There is a help page
"Creating a Child Process with Redirected Input and Output" for C++.
Since I don't know much about C++, can someone create a C# sample code
from it?
Once I have a working sample that can create child process as
impersonated user and redirect standard output and error, I will post
it in the newsgroups. Many people can benefit from it.