H
hellrazor
HI there,
I am developing a client side app which requires me to launch another
program when a user clicks a button on a web page. I thought I'd create
an asp.net page (using c# ) to accomplish this. After much research I
found that it's not that simple. The asp process runs under an aspnet
user, which does not let me launch my program. I ran accross some code
that is supposed to impersonate the logged in user, but I get the
following error:
"An anonymous identity cannot perform an impersonation"
The web.config file contains the following:
<identity impersonate="true" />
and the code in the asp.net page:
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
System.Security.Principal.WindowsImpersonationContext
impersonationContext;
impersonationContext =
((System.Security.Principal.WindowsIdentity)User.Identity).Impersonate();
System.Diagnostics.Process.Start("notepad.exe")
impersonationContext.Undo();
}
any ideas on how I can get around this?
Thanks!
Jorge
I am developing a client side app which requires me to launch another
program when a user clicks a button on a web page. I thought I'd create
an asp.net page (using c# ) to accomplish this. After much research I
found that it's not that simple. The asp process runs under an aspnet
user, which does not let me launch my program. I ran accross some code
that is supposed to impersonate the logged in user, but I get the
following error:
"An anonymous identity cannot perform an impersonation"
The web.config file contains the following:
<identity impersonate="true" />
and the code in the asp.net page:
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
System.Security.Principal.WindowsImpersonationContext
impersonationContext;
impersonationContext =
((System.Security.Principal.WindowsIdentity)User.Identity).Impersonate();
System.Diagnostics.Process.Start("notepad.exe")
impersonationContext.Undo();
}
any ideas on how I can get around this?
Thanks!
Jorge