إشعار
يتطلب الوصول إلى هذه الصفحة تخويلاً. يمكنك محاولة تسجيل الدخول أو تغيير الدلائل.
يتطلب الوصول إلى هذه الصفحة تخويلاً. يمكنك محاولة تغيير الدلائل.
Static member 'member' cannot be accessed with an instance reference; qualify it with a type name instead
Only a class name can be used to qualify a static variable; an instance name cannot be a qualifier. For more information, see Static Classes and Static Class Members.
The following sample generates CS0176:
// CS0176.cs
public class MyClass2
{
public static int num;
}
public class Test
{
public static void Main()
{
MyClass2 mc2 = new MyClass2();
int i = mc2.num; // CS0176
// try the following line instead
// int i = MyClass2.num;
}
}
التعاون معنا على GitHub
يمكن العثور على مصدر هذا المحتوى على GitHub حيث يمكنك أيضاً إضافة مشاكل وطلبات سحب ومراجعتها. للحصول على معلومات إضافية، اطلع على دليل المساهم لدينا.