共用方式為


編譯器錯誤 C3917

'property': 過時的建構宣告樣式

屬性或事件定義使用 Visual Studio 2005 之前版本的語法。

如需詳細資訊,請參閱 property

範例

// C3917.cpp
// compile with: /clr /c
public ref class  C {
private:
   int m_length;
public:
   C() {
      m_length = 0;
   }

   property int get_Length();   // C3917

   // The correct property definition:
   property int Length {
      int get() {
         return m_length;
      }

      void set( int i ) {
         m_length = i;
      }
   }
};