Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ASP / Database Access / August 2007



Tip: Looking for answers? Try searching our database.

Detect the name of the ASP.NET user

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vilhelm - 09 Aug 2007 19:54 GMT
I am making a ASP.NET application that connects to a database.

I want to distrtibute this to my customers that may have different Windows
OS, so my installer must handle different windows versions.

In my installer I am using the following SQL statement to enable ASP.NET to
connect to my database.
 CREATE LOGIN [NT AUTHORITY\NETWORK SERVICE] FROM WINDOWS
followed by
 sp_grantdbaccess 'NT AUTHORITY\NETWORK SERVICE'

This works like a charm when the ASP.NET user is NT AUTHORITY\NETWORK
SERVICE, but that is not the case for all Windows versions.
It even depends on the language of the windows operation system.

How do I detect (in C#) the name (including domain) of the user that runs
the ASP.NET process?

Thankful for any response.

-- Vihelm Heiberg
Bob Barrows [MVP] - 09 Aug 2007 20:10 GMT
> I am making a ASP.NET application that connects to a database.

There was no way for you to know it (except maybe by browsing through
some of the previous questions before posting yours - always a
recommended practice),  but this is a classic asp newsgroup. ASP.Net is
a different technology from classic ASP. While you may be lucky enough
to find a dotnet-savvy person  here who can answer your question, you
can eliminate the luck factor by posting your question to a newsgroup
where the dotnet-savvy people hang out.  I suggest
microsoft.public.dotnet.framework.aspnet.
There are also forums at www.asp.net where you can find a lot of people
to help you.

Signature

Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.