I believe every deployed product (application) from VS has a unique id or smth like that, that doesn't change over distribution. What I mean is that I publish an app and give it to a company with 100 employees and the product remains with the same unique ID on every single PC it is installed.
I have come across GUID
from Assembly Information
of the program's project, but I am not sure it is that one. So is there anything like such unique id of the product, and if yes - where can I find it AND how can I access it in the code itself.
I.e.: string uniqueID = Something.getProductID()
or whatever...
There are two methods to get GUID,
Fristly, you can get GUID in Assembly Information.
//Gets the assembly that contains the code that is currently executing.
Assembly asm = Assembly.GetExecutingAssembly();
Guid id= asm.GetType().GUID;
Secondly, It is not taken from the Assembly Information.Stored as a real custom attribute.
var attribute = (GuidAttribute)asm.GetCustomAttributes(typeof(GuidAttribute),true)[0].;
var id = attribute.Value;
http://msdn.microsoft.com/en-us/library/88d17d13.aspx
http://msdn.microsoft.com/en-us/library/system.reflection.assembly.getexecutingassembly.aspx