473,386 Members | 1,969 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,386 software developers and data experts.

what's the difference...

ari
hey all,

i was wondering what the difference is between obtaining a user name like

Request.ServerVariables("Auth_User").Split("\")(1) )

and

User.Identity.Name

Is one newer than the other or something like that?

thanks,
ari
Nov 19 '05 #1
5 1146
Request.ServerVariables("Auth_User").Split("\")(1) )
uses a language feature to parse a server variable.

User.Identity.Name uses a native .Net property

Using a native .net class is usually more efficient
than using a Server Collection like ServerVariables.

When you load ServerVariables you load the whole collection.
That's quite a lot of data.


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"ari" <ar*@discussions.microsoft.com> wrote in message
news:EF**********************************@microsof t.com...
hey all,

i was wondering what the difference is between obtaining a user name like

Request.ServerVariables("Auth_User").Split("\")(1) )

and

User.Identity.Name

Is one newer than the other or something like that?

thanks,
ari

Nov 19 '05 #2
ari
Thanks for the knowledge.

"Juan T. Llibre" wrote:
Request.ServerVariables("Auth_User").Split("\")(1) )
uses a language feature to parse a server variable.

User.Identity.Name uses a native .Net property

Using a native .net class is usually more efficient
than using a Server Collection like ServerVariables.

When you load ServerVariables you load the whole collection.
That's quite a lot of data.


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"ari" <ar*@discussions.microsoft.com> wrote in message
news:EF**********************************@microsof t.com...
hey all,

i was wondering what the difference is between obtaining a user name like

Request.ServerVariables("Auth_User").Split("\")(1) )

and

User.Identity.Name

Is one newer than the other or something like that?

thanks,
ari


Nov 19 '05 #3
Juan, is there any resource that maps the properties from the
ServerVariables collection to properties in a class that may be provided by
the framework?
<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
Request.ServerVariables("Auth_User").Split("\")(1) )
uses a language feature to parse a server variable.

User.Identity.Name uses a native .Net property

Using a native .net class is usually more efficient
than using a Server Collection like ServerVariables.

When you load ServerVariables you load the whole collection.
That's quite a lot of data.


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"ari" <ar*@discussions.microsoft.com> wrote in message
news:EF**********************************@microsof t.com...
hey all,

i was wondering what the difference is between obtaining a user name like

Request.ServerVariables("Auth_User").Split("\")(1) )

and

User.Identity.Name

Is one newer than the other or something like that?

thanks,
ari


Nov 19 '05 #4
Hi, Clinton.

Some, although not all, of the Server Variables are collected
by System.Web.HttpRequest as individual properties.

See :
http://beta.asp.net/QUICKSTART/util/...ss=HttpRequest

So, Request.ServerVariables("URL") is provided by System.Web.HttpRequest.Url
and Request.ServerVariables("APPLICATION_PHYSICAL_PATH ") is
provided by Request.PhysicalApplicationPath.

Interestingly, the whole ServerVariables Collection is also provided
by System.Web.HttpRequest as a separate NameValueCollection,
so all the Request.ServerVariables are available, although at the
performance cost mentioned.

The HttpRequest class adds a few properties not found in Request.ServerVariables, too.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Juan, is there any resource that maps the properties from the ServerVariables collection
to properties in a class that may be provided by the framework?
<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
Request.ServerVariables("Auth_User").Split("\")(1) )
uses a language feature to parse a server variable.

User.Identity.Name uses a native .Net property

Using a native .net class is usually more efficient
than using a Server Collection like ServerVariables.

When you load ServerVariables you load the whole collection.
That's quite a lot of data.


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"ari" <ar*@discussions.microsoft.com> wrote in message
news:EF**********************************@microsof t.com...
hey all,

i was wondering what the difference is between obtaining a user name like

Request.ServerVariables("Auth_User").Split("\")(1) )

and

User.Identity.Name

Is one newer than the other or something like that?

thanks,
ari




Nov 19 '05 #5
Close enough. Thanks Juan.

<%= Clinton Gallagher
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi, Clinton.

Some, although not all, of the Server Variables are collected
by System.Web.HttpRequest as individual properties.

See :
http://beta.asp.net/QUICKSTART/util/...ss=HttpRequest

So, Request.ServerVariables("URL") is provided by
System.Web.HttpRequest.Url
and Request.ServerVariables("APPLICATION_PHYSICAL_PATH ") is
provided by Request.PhysicalApplicationPath.

Interestingly, the whole ServerVariables Collection is also provided
by System.Web.HttpRequest as a separate NameValueCollection,
so all the Request.ServerVariables are available, although at the
performance cost mentioned.

The HttpRequest class adds a few properties not found in
Request.ServerVariables, too.

Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Juan, is there any resource that maps the properties from the
ServerVariables collection
to properties in a class that may be provided by the framework?
<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/
"Juan T. Llibre" <no***********@nowhere.com> wrote in message
news:%2***************@TK2MSFTNGP09.phx.gbl...
Request.ServerVariables("Auth_User").Split("\")(1) )
uses a language feature to parse a server variable.

User.Identity.Name uses a native .Net property

Using a native .net class is usually more efficient
than using a Server Collection like ServerVariables.

When you load ServerVariables you load the whole collection.
That's quite a lot of data.


Juan T. Llibre, ASP.NET MVP
ASP.NET FAQ : http://asp.net.do/faq/
Foros de ASP.NET en Español : http://asp.net.do/foros/
======================================
"ari" <ar*@discussions.microsoft.com> wrote in message
news:EF**********************************@microsof t.com...
hey all,

i was wondering what the difference is between obtaining a user name
like

Request.ServerVariables("Auth_User").Split("\")(1) )

and

User.Identity.Name

Is one newer than the other or something like that?

thanks,
ari



Nov 19 '05 #6

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

Similar topics

125
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
1
by: mike | last post by:
best regards: What is the difference between DOM Level 1 and DOM Level 2. Thank you. May god be with you.
5
by: radnus2004 | last post by:
Hi all, I am not clear what is the difference between signed and unsigned in C. Many say, unsigned means only +ve values and 0. Can I use unsigned int i = -3? What happens internally ? What...
10
by: tinesan | last post by:
Hello fellow C programmers, I'm just learning to program with C, and I'm wondering what the difference between signed and unsigned char is. To me there seems to be no difference, and the...
13
by: Jason Huang | last post by:
Hi, Would someone explain the following coding more detail for me? What's the ( ) for? CurrentText = (TextBox)e.Item.Cells.Controls; Thanks. Jason
12
by: Nathan Sokalski | last post by:
What is the difference between the Page_Init and Page_Load events? When I was debugging my code, they both seemed to get triggered on every postback. I am assuming that there is some difference,...
3
by: Anoj Kumar | last post by:
Hi All , can anyone tell me what is the difference between the following declaration and how it affects application performance. 1. Dim cn As ADODB.Connection Set cn = New ADODB.Connection
6
by: Mark Kamoski | last post by:
Hi Everyone-- Please help. What is the difference between a Field and a Property? Here is the context. In the VS.NET 2002 documentation, in the "String Members" section, we have the...
5
by: kai | last post by:
Hi, In ASP.NET , what is the difference between OnClick and Click events for a button? Because we have button click event, it can trigger events, why we still need OnClick? Please help. ...
49
by: Zach | last post by:
After having taken a looong break from VB (last used 6.0), I started getting back into programming again, this time with VS 2005. I began reading up on VB.NET from various sources (books,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
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
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...

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.