0

I want to have a form that runs on the first start of my windows form application, for the user to input information. I then want to store it in a database.

How can I uniquely identify a specific copy of my application on a computer so it can retrieve the users specific data?

Jack Otto
  • 3
  • 3
  • The question doesn't make much sense. If you want to load user-specific data you need the user's account name or ID, not some application identifier. You can get the current user with [WindowsIdentity.GetCurrent()](https://msdn.microsoft.com/en-us/library/sfs49sw0(v=vs.110).aspx) – Panagiotis Kanavos Apr 22 '15 at 10:14

3 Answers3

1

Assign an GUID to your app. It can be generated during the app installation and saved in the config, or you can just generate the quid on the first run of the application.

Radin Gospodinov
  • 2,313
  • 13
  • 14
  • That's no better than using a MAC address. The OP wants to identify the user but thinks (erroneously) that the way to go is to identify the machine. – Panagiotis Kanavos Apr 22 '15 at 10:25
  • I missed that part, but you can still use GUID and get the logged user hash code. Then generate new hash based on the GUID and the user. Use that hash for unique identifier. – Radin Gospodinov Apr 22 '15 at 10:29
  • I do not care who the user is and I don't want user accounts. To clarify, lets say 100 people are using my application. All posting and retrieving their unique data from my database. How can I identify each unique install of the application? – Jack Otto Apr 22 '15 at 10:31
  • @Jack Otto, then use the GUID part. This will identify the app. Each app installation will have unique Guid. If you want to identify the user and the app then you need to include the user unique identifier, so generating the hash code of the user name will be enough. – Radin Gospodinov Apr 22 '15 at 10:34
  • The GUID sounds like it would work great! Sorry I can not up vote. – Jack Otto Apr 22 '15 at 10:36
0

You can get the computers MAC address which should be unique - see this post on how to do this in c#

Community
  • 1
  • 1
auburg
  • 1,373
  • 2
  • 12
  • 22
0

You can get the login Account user name and MAC address. You can get the user name using this

Dino
  • 199
  • 2
  • 13