Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista General Discussion > How to update value of SystemInformation.UserName in Vista

Reply
Thread Tools Display Modes

How to update value of SystemInformation.UserName in Vista

 
 
Dean Slindee
Guest
Posts: n/a

 
      10-21-2007
When I loaded Vista it appears that I entered my FirstName/LastName in one
of the setup parameters. So, when I launch an application that I have
written and get the value in SystemInformation.UserName, the value returned
is "SLINDEED\Dean Slindee". What I want to be returned is
"SLINDEED\dslindee". "dslindee" is the value that shows on the startup
screen, and is also the administrator account. How can I change "Dean
Slindee" to "dslindee"?

Thanks,
Dean S

 
Reply With Quote
 
 
 
 
Andrew McLaren
Guest
Posts: n/a

 
      10-22-2007
"Dean Slindee" <> wrote ...
> When I loaded Vista it appears that I entered my FirstName/LastName in one
> of the setup parameters. So, when I launch an application that I have
> written and get the value in SystemInformation.UserName, the value
> returned is "SLINDEED\Dean Slindee". What I want to be returned is
> "SLINDEED\dslindee". "dslindee" is the value that shows on the startup
> screen, and is also the administrator account. How can I change "Dean
> Slindee" to "dslindee"?



Hi Dean,

It sounds like you have the Account Name and the Full Name back-to-front.
In a normal scenario, user Fred Smith will have Account Name "fsmith" and
Full Name "Fred Smith". When Fred Smith calls SystemInformation.UserName, it
would return "fsmith" - the Account Name (not the Full Name).

In your case, it sounds like you have account name "Dean Slindee" and Full
Name "dslindee".

Local accounts are a bit weird, coz you don't have the full ADSI/LDAP
apparatus. But I think you can change this pretty easily in Administrative
Tools, Computer Management. In the Computer Management snap-in, go to Local
Users and Groups, Users, and locate "Dean Slindee" in the Name column.
You'll probably see in the Full Name column "dslindee".

Right click the account record and choose "Rename". Change "Dean Slindee" to
"dslindee". Optionally, you might choose to change the Full Name "dslindee"
to "Dean Slindee" ... but that has no effect on the value returned by
SystemInformation.UserName.

SystemInformation.UserName generally returns just the user's name (ie
account name), not the full LanMan-style DOMAIN\user formatted name. For
that, you may need to get the SystemInformation.UserDomainName property,
then catenate the string with a "\" in the middle.

Hope it helps,

--
Andrew McLaren
amclar (at) optusnet dot com dot au


 
Reply With Quote
Reply

Thread Tools
Display Modes

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
Vista adds computername\ to username Poisondwarf Windows Vista Networking 9 09-19-2008 07:40 PM
IE 7.0/VISTA not caching Username & password Sam Windows Vista General Discussion 1 11-06-2007 02:22 PM
Vista, Username Marko Windows Vista General Discussion 2 07-14-2007 06:20 PM
Vista adds computername\ to username Poisondwarf Windows Vista Networking 0 10-09-2006 04:59 PM
Vista logon using numeric username? mdyoung Windows Vista Administration 0 06-15-2006 09:59 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59