473,383 Members | 1,792 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Logon userId

In a windows form, how can I retrieve the Windows userid (what we type in
the Ctrl-Alt-Suppr dialog box) of the current user ? Thank you.
Nov 21 '05 #1
3 1319
Environment.UserName
Or
Environment.GetEnvironmentVariable("USERNAME")

"Gilbert Tordeur" <gi*************@fr.york.com> wrote in message
news:eo**************@tk2msftngp13.phx.gbl...
In a windows form, how can I retrieve the Windows userid (what we type in
the Ctrl-Alt-Suppr dialog box) of the current user ? Thank you.

Nov 21 '05 #2
Hi,

Environment.username

Ken
-------------------------
"Gilbert Tordeur" <gi*************@fr.york.com> wrote in message
news:eo**************@tk2msftngp13.phx.gbl...
In a windows form, how can I retrieve the Windows userid (what we type in
the Ctrl-Alt-Suppr dialog box) of the current user ? Thank you.

Nov 21 '05 #3
* "Gilbert Tordeur" <gi*************@fr.york.com> scripsit:
In a windows form, how can I retrieve the Windows userid (what we type in
the Ctrl-Alt-Suppr dialog box) of the current user ? Thank you.


'Environment.UserName' or 'SystemInformation.UserName'.
Notice that the latter would require a reference to
"System.Windows.Forms.dll", and that's not the preferred way for
console/service applications.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #4

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

Similar topics

2
by: Gidrazas | last post by:
Hi all. I want to get data from Sybase ASA9 to report named Subjektai.rpt in web form. I made ODBC connection to DB and it looks OK. But whe i run project i get an error like this. Logon...
2
by: Mark Miller | last post by:
I'm not sure why this is happening. I'm trying to run a late-bound report. My original code looked like this: TableLogOnInfo logOnInfo = new TableLogOnInfo ();...
0
by: google | last post by:
My Crystal reports are being supplied the logon credentials via a C# code class that recursively loops through all the tables present in the reports and applies the login credentials (Servername,...
4
by: Rey | last post by:
Howdy all. Using VSNet 2003 on an XP Pro SP2 boox. Trying to use Crystal Reports to access an mdb file with access security/workspace. Simple report of customers but after spending mucho time...
0
by: Alixx Skevington | last post by:
OK, I am confused here, so I hope that somebody out there can help me out. I am trying to run a report allows me to choose the report and then change the logon info for it. Noiw before you say...
6
by: Alixx Skevington | last post by:
OK why does the following code work in a Windows form with a crystal report viewer but not in a webform. I get the usual CrystalReports.EngineLogONException logon Failed when this is called in...
3
by: Milan Todorovic | last post by:
Hello, I need help. I have experience in ASP.NET programming, but this is my first dealing with Crystal Reports. I'm trying to make the most basic report purely for testing purposes: connect to...
9
by: mollyf | last post by:
I have tried various suggestions that I have found searching the newsgroups and still haven't been able to figure why I keep getting the logon failed error. I created a report in Crystal (not...
0
by: bonita | last post by:
I come across the error "CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed." After I move my asp.net code from the development platform (XP professional) to the production web...
1
by: Ravimama | last post by:
I have a report where in I want to display the data from a subreport as well as a the main report. The sub report is the Company info as the header, for all the reports. with out a sub report...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.