Get user name

  • Thread starter Thread starter Brad Allison
  • Start date Start date
B

Brad Allison

Is there a simple way to get the current system user name?

Thanks for the information.

Brad
 
Hi,

Environment.UserName or SystemInformation.UserName

Ken
-------------------
Is there a simple way to get the current system user name?

Thanks for the information.

Brad
 
Got it, thanks. Now my next question is the username that is returned is
ComputerName/UserID. All I need is the user id. How would I take that
string and just get the last three characters?

I know this sounds like a simple question, but I do not have a lot of work
with strings.

Thanks for the info.

Brad
 
Got it! (Just the user name). I switched from SystemInformation to
Environment and it is returning just the username.

Thanks again.

Brad
 
Hi,

Try something like this.
Dim strUser As String =
Environment.UserName.Substring(Environment.UserName.IndexOf("/") + 1)



Ken

----------------------

Got it, thanks. Now my next question is the username that is returned is
ComputerName/UserID. All I need is the user id. How would I take that
string and just get the last three characters?

I know this sounds like a simple question, but I do not have a lot of work
with strings.

Thanks for the info.

Brad
 
Hi Ken,

I thought that I had seen you given this solution at least more than 3 times
in the last 3 days. (Very popular problem)

Nothing wrong with I was smiling and did want to tell you.

Cor
 
* "Brad Allison said:
Is there a simple way to get the current system user name?

'SystemInformation.UserName'
'Environment.UserName'
'WindowsPrincipal.Identity'
 
Cor Ligthert said:
Hi Ken,

I thought that I had seen you given this solution at least more than 3 times
in the last 3 days. (Very popular problem)

Nothing wrong with I was smiling and did want to tell you.

He may not be seeing it. I've been seeing (or NOT seeing) all kinds of weird
stuff including missing posts lately. I'm not the only one and others on
other NG's have mentioned it lately also.
 
Hi,

Noticed that too.

Ken
----------------
Hi Ken,

I thought that I had seen you given this solution at least more than 3 times
in the last 3 days. (Very popular problem)

Nothing wrong with I was smiling and did want to tell you.

Cor
 
Hi,

Most of the messages outlook express has reported as missing are
spam messages deleted by microsoft. Ocassionally I have had problems with
outlook express and have had to reset the account. Right click on the
newsgroup and select properties. Press the reset button in the local file
tab.

Ken
-----------------
Cor Ligthert said:
Hi Ken,

I thought that I had seen you given this solution at least more than 3 times
in the last 3 days. (Very popular problem)

Nothing wrong with I was smiling and did want to tell you.

He may not be seeing it. I've been seeing (or NOT seeing) all kinds of weird
stuff including missing posts lately. I'm not the only one and others on
other NG's have mentioned it lately also.
 
Back
Top