المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : A simple question... please help



C# Programming
05-04-2009, 02:27 PM
An object reference is required for the non-static field, method, or property
WTH does it want from me!??


namespace WindowsFormsApplication3
{
class Class1
{
public String astring;
public static void asdf()
{
String anotherstring;
astring = anotherstring; //It doesn't like this
}
}
}


I searched and found so many 1000s of similar problems but I couldn't figure out what I'm supose to do to fix it.... maybe 'cause I'm to tired to figure it out but there is nothing wrong with that program!
I want astring to be where it is and access from inside another function. Why can't I do this?