According to the online documentation:
The keyword const is used to modify a declaration of a field or local variable. It specifies that the value of the field or the local variable cannot be modified. A constant declaration introduces one or more constants of a given type. The declaration takes the form:
[attributes] [modifiers] const type declarators;where:
attributes (optional)
Optional declarative information. For more information on attributes and attribute classes, see C# Attributes.
modifiers (optional)
Optional modifiers that include the new modifier and one of the four access modifiers.
type
One of the types: byte, char, short, int, long, float, double, decimal, bool, string, an enum type, or a reference type.
So, as far as I understand, there is no way to do that because Guid is not listed in the types allowed for the const keyword.
But you can get away with something like:
const string strGuid = "CF0003D6-1F6E-4D6A-A6B1-7B18E5057FCD";
Guid gd = new Guid (strGuid);
and use the strGuid where you need.
--
Cezary Nolewajka
mailto:c.*********************@no-sp-am-eh-mail.com
remove all "no-sp-am-eh"s to reply
"PawelF" <fa****@visionsoft.com.pl> wrote in message news:e9**************@TK2MSFTNGP12.phx.gbl...
I need to replace string with Guid ready to use:
public const string GUID_1 = "CF0003D61F6E4D6AA6B17B18E5057FCD";
like
public const Guid ...
Is there any chance to do this.
pawelf