Hello,
I have a problem, how do I access static variables outside of a class? Here's some sample code:
public class Resource
{
public static string var1;
public static string var2;
public Resource()
{
Resource.var1 = "Hello";
Resource.var2 = "World";
}
}
Now when I create an instance of it in another file:
Resource r = new Resource();
I can't do this:
Label1.Text = Resource.var1;
so...smart people out there, let me know how I access these static variables please!
Thanks,
ghesse
I have a problem, how do I access static variables outside of a class? Here's some sample code:
public class Resource
{
public static string var1;
public static string var2;
public Resource()
{
Resource.var1 = "Hello";
Resource.var2 = "World";
}
}
Now when I create an instance of it in another file:
Resource r = new Resource();
I can't do this:
Label1.Text = Resource.var1;
so...smart people out there, let me know how I access these static variables please!
Thanks,
ghesse