Nota
Capaian ke halaman ini memerlukan kebenaran. Anda boleh cuba mendaftar masuk atau menukar direktori.
Capaian ke halaman ini memerlukan kebenaran. Anda boleh cuba menukar direktori.
The property or indexer 'property' cannot be used in this context because it lacks the get accessor
An attempt to use a property failed because no get accessor method was defined in the property. For more information, see Fields.
The following sample generates CS0154:
// CS0154.cs
public class MyClass2
{
public int i
{
set
{
}
// uncomment the get method to resolve this error
/*
get
{
return 0;
}
*/
}
}
public class MyClass
{
public static void Main()
{
MyClass2 myClass2 = new MyClass2();
int j = myClass2.i; // CS0154, no get method
}
}
.NET maklum balas
.NET ialah projek sumber terbuka. Pilih pautan untuk memberikan maklum balas: