Sturm
Sturm

Reputation: 4125

Detect machine change

I'm developing a small tool that is going to be distributed via executable. The first time it is executed I want a tutorial to be displayed. As users are supposed to copy/paste the tool to theirs coworkers it would be nice if I detect that the machine has been changed and display the tutorial again for the new user.

If I could identify the machine ID somehow I could store it (as a setting for example) and compare it at startup in order to display or not the tutorial.

Is there a way to identify somehow the current machine?

Upvotes: 0

Views: 110

Answers (2)

Chrisi
Chrisi

Reputation: 381

The Process Class has a property which indicates the machine name.

Process.GetCurrentProcess().MachineName

Edit

Or get the machine name from System.Environment.MachineName

(thanks to Andreas Niedermair for mentioning it)

Upvotes: 0

Christian Sauer
Christian Sauer

Reputation: 10899

Have a look at LocalStorage - which basically stores information per user. Write a small file on startup und check for it every time. If it's there, you know the user otherwise he is new.

Upvotes: 2

Related Questions