Wrox Programmer Forums
|
ASP Pro Code Clinic As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Pro Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 21st, 2004, 05:51 AM
Authorized User
 
Join Date: Dec 2004
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to get The UserName

hi guys... a doubt form

   i have used the command <%=Request.ServerVariables("LOGON_USER")
%>
but i did'nt get anything Displayed.

what should i do to get the user name displayed ..

plz need it Quick....

bye for now..


MuthuKumar.AL
__________________
MuthuKumar.AL
 
Old December 21st, 2004, 05:59 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Either change your web app configuration to disable anonymous access, or add this at the top of your page:
If Len(Trim(Request.ServerVariables ("LOGON_USER"))) = 0 Then
    Response.Status = "401 Unauthorized"
    Response.AddHeader "WWW-Authenticate", "NTLM"
    Response.End
End If
 
Old December 21st, 2004, 10:07 AM
Authorized User
 
Join Date: Sep 2004
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to nashnash
Default

<%
If Len(Trim(Request.ServerVariables ("LOGON_USER"))) = 0 Then
    Response.Status = "401 Unauthorized"
    Response.AddHeader "WWW-Authenticate", "NTLM"
    Response.End
End If
%>
<TABLE>
      <TR>
           <TD>
                <B>Server Varriable</B>
           </TD>
           <TD>
                <B>Value</B>
           </TD>
      </TR>

      <% For Each name In Request.ServerVariables %>
      <TR>
           <TD>
                <%= name %>
           </TD>
           <TD>
                <%= Request.ServerVariables(name) %>
           </TD>
      </TR>
      <% Next %>
</TABLE>


 
Old January 15th, 2005, 10:04 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 518
Thanks: 0
Thanked 0 Times in 0 Posts
Default

nice script








Similar Threads
Thread Thread Starter Forum Replies Last Post
Username and password Hennie Access 1 July 28th, 2006 12:43 AM
Detect Username dparsons ASP.NET 1.0 and 1.1 Professional 2 April 12th, 2006 02:20 PM
Username Changes Ben Horne Forum and Wrox.com Feedback 2 March 12th, 2004 12:20 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.