473,699 Members | 2,531 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Get user name

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

Thanks for the information.

Brad
Nov 20 '05 #1
9 1665
Hi,

Environment.Use rName or SystemInformati on.UserName

Ken
-------------------
"Brad Allison" <ba******@ukcdo gs.com> wrote in message
news:On******** ******@tk2msftn gp13.phx.gbl...
Is there a simple way to get the current system user name?

Thanks for the information.

Brad

Nov 20 '05 #2
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

"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:O2******** ******@TK2MSFTN GP10.phx.gbl...
Hi,

Environment.Use rName or SystemInformati on.UserName

Ken
-------------------
"Brad Allison" <ba******@ukcdo gs.com> wrote in message
news:On******** ******@tk2msftn gp13.phx.gbl...
Is there a simple way to get the current system user name?

Thanks for the information.

Brad

Nov 20 '05 #3
Got it! (Just the user name). I switched from SystemInformati on to
Environment and it is returning just the username.

Thanks again.

Brad

"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:O2******** ******@TK2MSFTN GP10.phx.gbl...
Hi,

Environment.Use rName or SystemInformati on.UserName

Ken
-------------------
"Brad Allison" <ba******@ukcdo gs.com> wrote in message
news:On******** ******@tk2msftn gp13.phx.gbl...
Is there a simple way to get the current system user name?

Thanks for the information.

Brad

Nov 20 '05 #4
Hi,

Try something like this.
Dim strUser As String =
Environment.Use rName.Substring (Environment.Us erName.IndexOf( "/") + 1)

Ken

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

"Brad Allison" <ba******@ukcdo gs.com> wrote in message
news:uY******** ******@TK2MSFTN GP11.phx.gbl...
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

"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:O2******** ******@TK2MSFTN GP10.phx.gbl...
Hi,

Environment.Use rName or SystemInformati on.UserName

Ken
-------------------
"Brad Allison" <ba******@ukcdo gs.com> wrote in message
news:On******** ******@tk2msftn gp13.phx.gbl...
Is there a simple way to get the current system user name?

Thanks for the information.

Brad


Nov 20 '05 #5
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
Nov 20 '05 #6
* "Brad Allison" <ba******@ukcdo gs.com> scripsit:
Is there a simple way to get the current system user name?


'SystemInformat ion.UserName'
'Environment.Us erName'
'WindowsPrincip al.Identity'

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
<URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 20 '05 #7
"Cor Ligthert" <no**********@p lanet.nl> wrote in message
news:OD******** ******@TK2MSFTN GP10.phx.gbl...
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.
Nov 20 '05 #8
Hi,

Noticed that too.

Ken
----------------
"Cor Ligthert" <no**********@p lanet.nl> wrote in message
news:OD******** ******@TK2MSFTN GP10.phx.gbl...
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

Nov 20 '05 #9
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
-----------------
"Ricky W. Hunt" <rh*****@hotmai l.com> wrote in message
news:JabMc.1697 80$XM6.92728@at tbi_s53...
"Cor Ligthert" <no**********@p lanet.nl> wrote in message
news:OD******** ******@TK2MSFTN GP10.phx.gbl...
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.

Nov 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
12688
by: Tom Loach | last post by:
Our system administrator set up an NT server group in order to allow our users to login to our application via https to our sql server. The group appears as a User in SQL Server when you look at it in Enterprise Manager. That said, I can not see the users associated with the group from Enterprise Manager, but know they can login to the database. The problem is this. When we login via the web we get access to the database without...
2
6608
by: Technical Group | last post by:
Friends, Can anybody help me out by sending a piece of C# code showing how to add an active directory user to a particular user group? If the group does not exist, then create it. Thanks in advance -Hari
6
2432
by: Andrew Chalk | last post by:
My application attempts to connect to an SQL Server database as name ASPNET and Login Name SERVERNAME/ASPNET in response to these commands: SqlConnection myConnection = new SqlConnection("Data Source=(local);Initial Catalog=MCSCRE;Integrated Security=SSPI"); myConnection.Open(); However, the user of this database is ASPNET. I can't create a user ASPNET with a login name SERVERNAME/ASPNET, SQL Enterprise Manager always keeps the name...
1
2005
by: tony | last post by:
Hello! I just want to find out how the system find the name to set on a assembly User control dll. I have done this. 1. Create a user control - Here the namespace was set by the system to WindowsControlLibrary2 - The name of the class was also set by the system to UserControl1 - The name of the assembly dll was set by the system to
3
10922
by: Dmitry | last post by:
I am trying to figure out how to pass set of credentials to System.IO Challenge is: App is running under one set of credentials, but via GUI user have a chance to enter another set. I would like to be able to use supplied credentials with System.IO versus using default credentials that app is running under. So far I am forced to use WMI which is less convenient and slower then System.IO, but it's providing me with "Connection Options"
2
1840
by: underground | last post by:
Hi, everyone I've been trying to figure out a way for a user to update there information. I'm using sections to identify the specific user..Here is the form <? include("include/session.php"); ?> <? $username="xxxxxx"; $password="xxxxxxx"; $database="xxxxx";
3
2793
by: Terry Olsen | last post by:
I'm trying to add a domain user to a local group using the code below: Dim LCL As New DirectoryEntry("WinNT://" + Environment.MachineName + ",computer") Dim DOM As New DirectoryEntry("WinNT://us.ups.com") Dim DOMUSR As DirectoryEntry = DOM.Children.Find("USERID", "user") Dim LCLGRP As DirectoryEntry = LCL.Children.Find("LOCAL_GROUP", "group")
2
2597
by: dgbergman | last post by:
I have created a php login page in my site for my company. The goal is to get people into members area. Below is a list of steps that I take to create my login page in Dreamweaver CS3, can some one verify that I have built the page correct and that is nothing wrong with the code. If there is something wrong with the code is it possible to explain a step by step process to have a successful login page as I am new to creting php codes and pages in...
0
3231
by: rbukkara | last post by:
Hi, I have got the following error while trying to add a user in the LDAP Directory. javax.naming.NameNotFoundException: ; remaining name 'uid=vassila,ou=People,dc=cs,dc=uno,dc=edu' I have given all the attributes which are needed, for the user, in the code and also the proper path where the user has to be added. Please have a look at my code CODE] // This is a class file which stores all the info required for the user
14
3259
by: chromis | last post by:
Hi, I've been trying to implement a more OOP oriented approach to dealing with user security on one of my websites, and I am trying to validate the user against an array of roles, however I am struggling with a type error: The argument ROLES passed to function setRoles() is not of type array. If the component name is specified as a type of this argument, the reason for this error might be that a definition file for such component...
0
8620
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9180
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9038
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8920
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7755
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6536
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4378
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3060
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2012
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.