Hi im trying to assign a guid in my windows application and have the following code:

Guid g = Guid.NewGuid();
label2.Text = Convert.ToString(g);

however this generates a different guid everytime the program is ran, just wondering if theres any way of assigning a GUID that doesn't change?

Hi

A GUID (Globally Unique Identifier) by its definition will change each time you request one. If you want a persistent one then you will need to generate it once and save it somewhere.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.