Global.asax & Request.ServerVariables

G

Guest

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
 
K

Kevin Spencer

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,828
Latest member
LauraCastr

Latest Threads

Top