Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: RE: Getting Username


Message #1 by "Yu, Kevin" <kyu@N...> on Mon, 3 Dec 2001 10:22:42 -0500
This message is in MIME format. Since your mail reader does not understand

this format, some or all of this message may not be legible.



------_=_NextPart_001_01C17C0E.5A170910

Content-Type: text/plain;

	charset="ISO-8859-1"



< %@Import <mailto:%@Import>  Namespace="System.Security.Principal" %>

<script language="VB" runat="server"> 

 

SUB Page_Load(Src As Object, E As EventArgs)

 

 IF User.Identity.IsAuthenticated Then    

     'represents this users Indentity object

     Dim objIdentity = CType(User.Identity, WindowsIdentity)

 

     'get the current WindowsIdentity object for this user

     'this contains more specific information

     Dim objWinIdentity = objIdentity.GetCurrent()

 

     'load appropriate page for user

    

  IF User.IsInRole("BUILTIN\Administrators")

   Server.Transfer("login_admin.aspx")

  ELSE 

   Server.Transfer("login_user.aspx")

  END IF

 

   Else

     msgHello.InnerHtml = "Hello, you were not authenticated"

   End If

 

END SUB



 

have fun.

-----Original Message-----

From: phaneendra [mailto:phaneendra@s...]

Sent: Friday, November 30, 2001 3:11 AM

To: ASP+

Subject: [aspx] Getting Username





Hi All,

By using ASP.NET I want to get the user name with which the client logged to

the system.

Any help in this regard is appreciated.

 

Regards,

Phaneendra.

 

---

VBug Winter Conference 2001 



Open Forum: Dan Appleman will be hosting an open 

forum at The .NET Developer's Conference on 

29th November 2001. The session will give 

developers the chance to discuss and question 

Dan on his experience with the .NET environment. 

Dan has been programming Visual Basic since the 

alpha version 1.0. And with over 10 years 

Visual Basic experience is well qualified to 

help you on your road to being a .NET Guru.



http://www.vbug.co.uk/redirect.asp?url=39&id=17



---

You are currently subscribed to 

aspx as: kyu@n...


$subst('Email.Unsub') Read the future with ebooks at B&N

http://service.bfast.com/bfast/click?bfmid=2181&sourceid=38934667&categoryid

=rn_ebooks 





  Return to Index