Last post Feb 02, 2013 02:17 AM by jamesdj7787
Feb 01, 2013 12:49 AM|jamesdj7787|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 06:39 AM|jprochazka|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 02:17 AM|jamesdj7787|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.