Introducing DotNetFunda.com on mobile http://m.dotnetfunda.com ! Be with DotNetFunda.com on the go !
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 8551 |  Welcome, Guest!   Register  Login
 Home > Code Snippets > C# > Get Current Logged on User Name of Windows Operating System using C# ...
T.saravanan

Get Current Logged on User Name of Windows Operating System using C#

 Code Snippet posted by: T.saravanan | Posted on: 9/14/2010 | Category: C# Codes | Views: 4040 | Status: [Member] [MVP] | Points: 40 | Alert Moderator   


Hi All,

Here i am get a Current System Information of Windows Operating System using C#

string sData=string.Empty;


//Get Current User Name of Windows Operating System
sData=Environment.UserName;

//Get Domain Name of the System
sData=Environment.UserDomainName;

//Get System Directory
sData=Environment.SystemDirectory;

//Get Version of Windows Operating System
sData=Environment.OSVersion.VersionString;

//Get NetBIOS Name of Local System
sData=Environment.MachineName;

//Get Current Working Directory(Folder)
sData=Environment.CurrentDirectory;

//Get Current Platform of Windows Operating System
sData=Environment.OSVersion.Platform.ToString();

//Get No.of Processor of Current Machine
int n=Environment.ProcessorCount;

//Get a Time Count Start From System Started (Value comes in MilliSeconds)
long Time=Environment.TickCount;

If you Calculate a Time in Hour means
(Time/(1000*3600) -->we get Total Hours


I hope this helpful.

Cheers :)

Thanks & Regards
T.Saravanan
Found interesting? Add this to:


>> Write Response - Respond to this post and get points

More codes snippets

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you found plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/21/2012 8:36:57 AM