User who runs .net web application

Posted by Rahuljgosavi under Visual Studio on 6/23/2011 | Points: 10 | Views : 2168 | Status : [Member] | Replies : 5
Hi,

I just need to know which user gets allocated when we run .Net web application from Visual Studio ?
If we host application ISS , we can set the user rights like 'Integrated with Windows' or anynomous access checkboxes.

Please let me know if there is any problem in understanding this.

Regards,
Rahul




Responses

Posted by: Karthikanbarasan on: 6/23/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
i hope the default user will be the logged in user...

Thanks
Karthik
www.f5Debug.net

Rahuljgosavi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 6/23/2011 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
on the Local machine if you are still debugig your app it is the logged in user as "Karthikanbarasan" said, but on the IIS , if you are using XP , it is user "ASPNET"

Thank you for posting at Dotnetfunda
[Administrator]

Rahuljgosavi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Ndebata on: 6/24/2011 [Member] Starter | Points: 25

Up
0
Down
You use System.Security..Principal namespace for this.
http://www.dotnetfunda.com/codes/code1516-how-to-know-under-which-account-my-aspnet-application-is-running-.aspx


Rahuljgosavi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Susanthampy on: 6/24/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Dim User = System.Security.Principal.WindowsIdentity.GetCurrent.User

Dim UserName = User.Translate(GetType(System.Security.Principal.NTAccount)).Value


Regards,
Susan

Rahuljgosavi, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Susanthampy on: 6/24/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
3
down vote


C#

Response.Write("Windows Account which runs ASP.NET is: " 

+ Environment.Username);


VB.NET

Response.Write("Windows Account which runs ASP.NET is: " _

& Environment.Username)


Regards,
Susan

Rahuljgosavi, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response