473,657 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Detect in C# the name of the ASP.NET user.

I am making a ASP.NET application that connects to a database.

I want to distribute this to my customers that may have different Windows
OS, so my installer must handle different windows versions.
The installer makes sure SQL Server 2005 is there, IIS is ready and ASP.NET
is set up properly.

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

This works like a charm when the ASP.NET user is NT AUTHORITY\NETWO RK
SERVICE, but that is not the case for all Windows versions.
It even depends on the language of the windows operation system.
Example: I tried it on a Swedish Windows 2003 Server, and then the user was
"NT INSTANS\NETWORK SERVICE"
Again, on other machines, the user is "machinename\AS PNET"

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

Thankful for any response
Aug 9 '07 #1
0 1195

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
6505
by: David McCulloch | last post by:
QUESTION-1: How can I detect if Norton Internet Security is blocking pop-ups? QUESTION-2a: How could I know if a particular JavaScript function has been declared? QUESTION-2b: How could I know if Window.Open has been redefined? BACKGROUND:
3
9319
by: Raj | last post by:
Hi All, Is it possible to detect if a client software is installed on a machine using browser javascript. we are building a web/windows software and when the user logs into the web application, we want to detect if our software is installed on the client machine and if so we want to provide more access, or else we want to give the user a limited access to the web site Thanks in Advance
4
2959
by: vulcaned | last post by:
Hi All, Hopefully I explain this well........ In Access97 I have a form which has a tab control on it, each tab has a sub-form which is bound to its appropriate table(I'll call them 'Detail' tables). I have a 'Header' table and fields from it are displayed on the form above the tab control. Header table name is tblClientInfo Detail tables are tblPolicyInfo, tblBeneInfo, tblRiderInfo
3
6819
by: Hardy Wang | last post by:
Hi, I have a HttpModule in my ASP.NET application, in AuthorizeRequest event, I want to detect if page is posted back. Is there a way? using System; using System.Web; namespace MyModule { /// <summary>
5
3944
by: John Lee | last post by:
Hi, I have a component with some static public methods and is it possible from inside my method to decide if my component is invoked by an ASP.NET application (such as web service) or a windows application? If YES, How to do that? If I know it's invoked by web service (web service is configured as windows authentication only and assigned an application pool with NT domain account as identity), Is the following assumption is 100%...
16
4397
by: google | last post by:
Hello, I am working on an Acc2003 app for my company. In the interest of reducing chances of corruption due to unstable network connectivity, I would like to either prevent users from running it through a wireless connection, or limit their use to read-only. I have absolutely no idea if this is possible, and if so, how. Is there any way from within Access to get the list of routers they are connecting through? Ideally, I'd like to keep...
5
4066
by: Roshan | last post by:
Hi, Given a name, I want to be able to detect if a user or a group account exists with that name on a system and know if its a user or a group. My search yielded the "LookupAccountName" Win32 API but I haven't found any class in .NET that allows me to do that. Does any one know of a class in .NET or a way of doing this without using Win32 APIs ?
11
10732
by: mp- | last post by:
I want to be able to allow people to check their email from my PHP online application. Given only the users 1) email address, 2) username (if applicable) and 3) password - how can I auto detect a remote IMAP/POP3 server so that I can connect and fetch mail for the user. (Ultimately, I don't want users to have to know what the IMAP/POP3 server name / port is .... I would like to auto-detect all of that). At first I thought I could use...
0
8407
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8319
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8739
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8612
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7347
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4171
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2739
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.