using Guid struct as a variable
Hi everyone,
Im using C# 2008. I have a problem wherein i wanted to use the System.Guid as a variable. is this possible? because im having a hard time trying to figure out how to assigned a value to that variable.
Check this out guys:
Code:
public partial class FrmLogin : Form
{
private static Guid prv_FormID;
public FrmLogin()
{
InitializeComponent();
}
/// <summary>
/// Guid of this form
/// </summary>
public static Guid FormID
{
get
{
return prv_FormID;
}
}
i want to assign a predefined value to the prv_FormID
something like this:
Code:
public partial class FrmLogin : Form
{
private static Guid prv_FormID = "5c95ad91-24f9-4ad6-a5c2-b192daa48953";
public FrmLogin()
{
InitializeComponent();
}
/// <summary>
/// Guid of this form
/// </summary>
public static Guid FormID
{
get
{
return prv_FormID;
}
}
but of course its wrong. because its a string and not a Guid.
Please help! i really appreciate if someone can give me some flash light on this problem :D
Re: using Guid struct as a variable
Try it like this.
Code:
private static Guid prv_FormID = new Guid("5c95ad91-24f9-4ad6-a5c2-b192daa48953");