Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 02, 2013 06:17 AM by jamesdj7787
Feb 01, 2013 04:49 AM|LINK
I had developed a asp.net application using C#. I want to deploy it on client machine. I will be creating an .exe file which can be installed on client machine.
I need a code or script using which I can retrieve local machine name and user account name during installation of .exe file.
Any help will be appreciated.
Thanks in Advance..
Feb 01, 2013 10:39 AM|LINK
You can get the users name by using System.Security.Principal and using the following code:
string userName = WindowsIdentity.GetCurrent().Name;
To get the machine name:
string machineName = System.Environment.MachineName;
Of course as you know these will only work on an executable running on said machine.
Feb 02, 2013 06:17 AM|LINK
Thanks for your reply..
I had found the solution to retrieve username and computer name.
I used customActionData parameters [USERNAME] and [ComputerName] to retrieve and store.
Thanks once again.