Creating GUID programmatically ?

  • Thread starter Thread starter genc ymeri
  • Start date Start date
G

genc ymeri

How can I create a GUID programmatically instead of writting it manually as
it is below ?

Thank You very much in advanced !

Guid CLSID_Application = new Guid("{0x00021A20, 0x0000, 0x0000, {0xC0, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x46}}");
 
Genc,

You can call the static NewGuid method on the Guid structure to create a
new GUID.

Hope this helps.
 
genc ymeri,
Have you looked at the Guid.NewGuid() function?
Guid CLSID_Application = Guid.NewGuid();

Which will create a new GUID each time it is ran.

Also the constructor to Guid is overloaded, so you do not need to pass only
a string...

Hope this helps
Jay
 
Back
Top