reg: gettting user name in asp.net

From: rama (ramakrishnam@indosoft.stph.net)
Date: 04/25/03


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



Relevant Pages

  • runtime error in my application
    ... when iam running a process called convertin my application ... which is to convert data from excel sheet to sql server table it's giving me ... This process is to convert data From EXcel file to ... Dim oSheet As Excel.Worksheet ...
    (microsoft.public.vb.bugs)
  • runtime error in application
    ... when iam running a process called convertin my application ... which is to convert data from excel sheet to sql server table it's giving me ... This process is to convert data From EXcel file to ... Dim oSheet As Excel.Worksheet ...
    (microsoft.public.vb.bugs)
  • runtime error in the application
    ... when iam running a process called convertin my application ... which is to convert data from excel sheet to sql server table it's giving me ... This process is to convert data From EXcel file to ... Dim oSheet As Excel.Worksheet ...
    (microsoft.public.vb.bugs)
  • Re: gettting user name in asp.net
    ... Iam getting user name and domain> also. ... > name as rama, but iam getting user name as SYSTEM.From where it's getting> the user name as ... > sub Page_Load> dim uns ...
    (microsoft.public.dotnet.security)
  • Re: Creating one file out of many, including the filename
    ... John - hoe exactly do I run this code in access? ... > Dim fso 'As FileSystemObject ... > And here (this is why I prefer Perl for little utilities) is a Perl ... >>I have several hundred .csv files that Iam trying to combine in one file. ...
    (microsoft.public.access.externaldata)