Public Const ClassId = "92A1377A-7A3C-4FAF-94DA-C229AFFCFB12"
Public Const InterfaceId = "2DE393C7-300A-46DB-B33C-583B2765C2F9"
Public Const EventsId = "5452FC4D-C0C2-4E2B-87CA-8F43EAA14998"
I found this in a code snippet and need to create my own GUID in vb.net. But I didn't find a way that the program automatically creates constantes like this and shows them in the code. How can I do that? I'm not yet familiar with GUIDs but I suppose there were created automatically.
Thanks for any hints :)
First point is that you cannot apply const modifier to GUID's as const is applied on primitive datatype. If you want you can use Shared ReadOnly.
Second point is you can refer Guid.NewGuid Method () which is used to create GUID. Something like
Dim str = Guid.NewGuid.ToString()
EDIT:
A good MSDN reference which you have found yourself can be helpful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With