Sunday, 23 November 2014

How to get current application path, current user's name and current application name in c#?

To get current application path:
MessageBox.Show(Application.ExecutablePath);

To get current user's name:
MessageBox.Show(System.Security.Principal.WindowsIdentity.GetCurrent ().Name);

To get current application name:
MessageBox.Show(Application.ProductName);

No comments:

Post a Comment