473,480 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Global.asax & Request.ServerVariables

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 24 '06 #1
1 2865
The "Request" in Request.ServerVariables is an instance of the HttpRequest
class, which encapsulates the HTTP Request sent by a client. A Request is
made for a resource, such as an ASPX page, by an individual. Therefore, you
want to get it when you are responding to a Request; that is, usually in an
instance of a Page.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

Sequence, Selection, Iteration.
"Oren" <Or**@discussions.microsoft.comwrote in message
news:22**********************************@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 #2

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

Similar topics

0
1373
by: Jay Esguerra | last post by:
Is there a way where I can use the request.servervariables collection in the global.asax file. The problem is that I need to determine the domain name and set a variable when the application...
5
1975
by: Homer J. Simpson | last post by:
Hi, Any idea to get the -REAL- number of active users -WITHOUT- this kind of code ? ---------------------------------------------------------------------------- --------- Sub Session_OnStart...
1
6296
by: Stu | last post by:
Hi, Im using vis studio 2003 and I think wse is out of the question as clients could be using java which doesnt support it. So I managed to find some code which allows you to develop a custom...
0
2576
by: Patrick | last post by:
Greetings, I'm running into an intermittant issue on a web site running dotNet 1.1 sp1. The global.asax the client is using is set up so that it can be used in production, developement, and...
8
1900
by: Bill | last post by:
Anyone have any success in using global.asax to protect images in a folder from being linked to by external websites? I'd tried to use global.asa in the past, with no success. Any help would be...
0
2419
by: hynek.cihlar | last post by:
A strange behaviour thatI found in ASP.NET 2.0. I am trying to issue a callback request (handled by ICallbackEventHandler and RaiseCallbackEvent) and a regular GET request in the client browser...
1
3266
by: Anonieko | last post by:
Global.asax? Use HttpModules Instead! In a previous post, I talked about HttpHandlers - an underused but incredibly useful feature of ASP.NET. Today I want to talk about HttpModules, which are...
19
10147
by: furiousmojo | last post by:
This is a strange problem. I have a project where the contents of global.asax application_error are not firing. It is an asp.net 2.0 application using web application projects. I have another...
16
3760
by: Seguros Catatumbo | last post by:
Hi everyone. Is there a way i can find out the value of HTTP_REFERER when using application_error in global.asax? I am using: if (HttpContext.Current.Request.ServerVariables != null) {...
0
7039
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,...
0
7037
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7080
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...
1
6735
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...
1
4770
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4476
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2977
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
558
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
176
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.