473,395 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

get domain name - Global.asax

Hello,
I tried to get UserName and Domain by doing:
System.Collections.Specialized.NameValueCollection var =
Request.ServerVariables;
string[] sLogonUserArr = var["LOGON_USER"].ToString().Split('\\');

It's not working at the Global.asax file in the events:
Application_Start, Application_End, Application_Error, Session_Start,
Session_End

How can I get them ?

thanx,
Oren
Jul 25 '06 #1
3 5640
Are you talking about the user who wants to log in or the user that is
logged into the domain of the computer that is accessing the site?

Oren wrote:
Hello,
I tried to get UserName and Domain by doing:
System.Collections.Specialized.NameValueCollection var =
Request.ServerVariables;
string[] sLogonUserArr = var["LOGON_USER"].ToString().Split('\\');

It's not working at the Global.asax file in the events:
Application_Start, Application_End, Application_Error, Session_Start,
Session_End

How can I get them ?

thanx,
Oren
Jul 25 '06 #2
hi,
I mean the user/domain that accessed to IIS.

"Ray Booysen" wrote:
Are you talking about the user who wants to log in or the user that is
logged into the domain of the computer that is accessing the site?

Oren wrote:
Hello,
I tried to get UserName and Domain by doing:
System.Collections.Specialized.NameValueCollection var =
Request.ServerVariables;
string[] sLogonUserArr = var["LOGON_USER"].ToString().Split('\\');

It's not working at the Global.asax file in the events:
Application_Start, Application_End, Application_Error, Session_Start,
Session_End

How can I get them ?

thanx,
Oren
Jul 25 '06 #3
How do you think you can get a UserName/Domain in Application_Start.
There are no users. Application just starting.......
--------------------------------------------------------------
You can get it in Session_Start because that event is a direct response on
user hitting the site first time.

Most likely you need to set NT Authentication in IIS management and disable
anonymous access to your application. Then IIS will authenticate user and
LOGON_USER will be available.

------------------------------------------------------------------

You can not get that info in Session_End simply becuase this even is not a
response to any user action. The Request object is not available.
Session_End fire up after 20 minutes from lat time user hit your site.

George.
"Oren" <Or**@discussions.microsoft.comwrote in message
news:A6**********************************@microsof t.com...
Hello,
I tried to get UserName and Domain by doing:
System.Collections.Specialized.NameValueCollection var =
Request.ServerVariables;
string[] sLogonUserArr = var["LOGON_USER"].ToString().Split('\\');

It's not working at the Global.asax file in the events:
Application_Start, Application_End, Application_Error, Session_Start,
Session_End

How can I get them ?

thanx,
Oren

Jul 25 '06 #4

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

Similar topics

2
by: dan | last post by:
my understanding is that whenever a global.asax page is placed in a directory ALL files in that directory and files in subdirectories will be affected, unless another global.asax page exists in a...
2
by: Norton | last post by:
I understand how to create HTTP modules that can be used to add functionality to a website but there are a few things I don't understand. If I create an HTTP Module and I want it to intercept a...
2
by: Nathan Sokalski | last post by:
I would like to access variables and functions that I declare in the Global.asax.vb file. However, I am having trouble doing that. What does the declaration have to look like in the Global.asax.vb...
8
by: Vishwanathan Raman | last post by:
Hi I have a declared a static DataSet object SOBJ in Global.asax.I also have a localy defined DataSet LSOBJ in Global.asax which I am storing in Application State.Is there any technical...
7
by: Ankit Aneja | last post by:
I put the code for url rewrite in my Application_BeginRequest on global.ascx some .aspx pages are in root ,some in folder named admin and some in folder named user aspx pages which are in user...
3
by: kingski | last post by:
I have a web site created with ASP.NET 1.1. availability Global.asax: protected void Application_PreRequestHandlerExecute(Object sender, EventArgs e)
11
by: Ron | last post by:
I have a web project compiled with the new "Web Deployment Projects" plugin for VS2005. I'm deploying the web project to one assembly and with updateable option set to ON. When I'm running the...
8
by: Doug | last post by:
Visual Studio 2005, SQL Server 2000, ASP.NET/VB.NET Not allowed to use the ASPNET machine account in SQL Server (very strict environment). Need to use Windows authentication, so we use...
3
by: Doug | last post by:
Using Visual Studio 2005, SQL Server 2000, and ASP.NET/VB.NET for a Web Application. We have a System DSN using Windows NT authentication defined on the development box to connect to the SQL...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.