reg: gettting user name in asp.net
From: rama (ramakrishnam@indosoft.stph.net)
Date: 04/25/03
- Next message: Mart: "How to programmatically retrieve certificate from system key store"
- Previous message: rama: "Re: Help to Get User Name And their roles ! Urgent"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: "rama" <ramakrishnam@indosoft.stph.net> Date: Fri, 25 Apr 2003 11:11:10 +0530
Hi All:
Thanx for ur suggestions. This is my code. Iam getting user name and domain
also. But iam not getting
the user name which i entered when iam autheticated thorugh IIS, after
setting Integrated Windown
Authentication on. For eg: Iam in groupware domain and the user name is
rama...So i should get user
name as rama, but iam getting user name as SYSTEM.From where it's getting
the user name as
SYSTEM.WHY is it so? Please help me out to get rid of this problem.
<%@ Import Namespace="System.Security.Principal" %>
<html>
<script runat="server">
sub Page_Load(o as object, e as eventargs)
dim uns
'uns=User.Identity.Name
uns=CType(User.Identity,WindowsIdentity)
dim uns1
uns1=uns.GetCurrent()
response.write(uns1.Name)
dim str1() as string
str1=Microsoft.VisualBasic.Split(uns1.Name,"\")
response.write(str1(1))
response.write(uns1.IsAuthenticated)
response.write(User.IsInRole("BUILTIN\Adminitrators"))
end sub
</script>
</html>
****** Iam getting the output as follows:
NT AUTHORITY\SYSTEM
SYSTEM
True
False
**********************************
Thanx In Advance
Rama Krishna.M
- Next message: Mart: "How to programmatically retrieve certificate from system key store"
- Previous message: rama: "Re: Help to Get User Name And their roles ! Urgent"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|