Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Remove domain from request.servervariables("LOGON_USER")

Reply
Thread Tools

Remove domain from request.servervariables("LOGON_USER")

 
 
Dave Karmens
Guest
Posts: n/a
 
      04-21-2004
How can I remove the domain name and the \ from
request.servervariables("LOGON_USER") ?

Remove everything up to, and include the \ ...
 
Reply With Quote
 
 
 
 
Ray at
Guest
Posts: n/a
 
      04-21-2004
Here's one of many ways:

aName = Split("\" & Request.ServerVaribles("LOGON_USER"), "\")
sName = aName(UBound(aName))

Ray at work


"Dave Karmens" <> wrote in message
news:...
> How can I remove the domain name and the \ from
> request.servervariables("LOGON_USER") ?
>
> Remove everything up to, and include the \ ...



 
Reply With Quote
 
 
 
 
Rob Meade
Guest
Posts: n/a
 
      04-21-2004
"Dave Karmens" wrote ...

> How can I remove the domain name and the \ from
> request.servervariables("LOGON_USER") ?
>
> Remove everything up to, and include the \ ...


Perhaps;

<%
Dim aName
Dim strName

' create an array by splitting variable by the \
aName = Split(Request.ServerVariables("LOGON_USER"), "\")

' populate variable
strName = aName(UBound(aName))

' clear down
aName Erase

' display to screen
Response.Write strName
%>

Assumptions are that you have actually returned something in that server
variable - if not it'll error - you'll need to put some additional checks
around this perhaps.

Hope this helps,

Regards

Rob


 
Reply With Quote
 
Rob Meade
Guest
Posts: n/a
 
      04-21-2004
"Ray at <%=sLocation%> [MVP]" wrote ...

> Here's one of many ways:
>
> aName = Split("\" & Request.ServerVaribles("LOGON_USER"), "\")
> sName = aName(UBound(aName))


Damn you beat me!

Rob


 
Reply With Quote
 
Dave Karmens
Guest
Posts: n/a
 
      04-21-2004
thanks guys

Ray at <%=sLocation%> [MVP] wrote:

> Here's one of many ways:
>
> aName = Split("\" & Request.ServerVaribles("LOGON_USER"), "\")
> sName = aName(UBound(aName))
>
> Ray at work
>
>
> "Dave Karmens" <> wrote in message
> news:...
>
>>How can I remove the domain name and the \ from
>>request.servervariables("LOGON_USER") ?
>>
>>Remove everything up to, and include the \ ...

>
>
>

 
Reply With Quote
 
Roland Hall
Guest
Posts: n/a
 
      04-22-2004
"Rob Meade" wrote in message
news:lhAhc.318$...
: ' clear down
: aName Erase

Erase aName

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Making a server on one domain the domain controller of a new domain Limited Wisdom MCSA 7 09-13-2006 02:18 AM



Advertisments