<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # Compiler Error CS1729 “type”不包含采用“number”參數的構造函數。 在直接或間接調用類的構造函數時,如果編譯器找不到具有相同數量參數的任意構造函數,則會發生此錯誤。在下面的示例中,test 類沒有采用任意參數的構造函數。因此,該類只有不含參數的默認構造函數。由于在生成該錯誤的第二行上,派生類沒有聲明其自己的構造函數,因此編譯器將提供默認構造函數。該構造函數在基類中調用無參數構造函數。由于基類沒有此類構造函數,因此會生成 CS1729。 ## 更正此錯誤 1. 調整構造函數調用中的參數數量。 2. 修改相應的類,提供包含必須調用的參數的構造函數。 3. 在基類中提供無參數構造函數。 下面的示例生成 CS1729: ``` // cs1729.cs class Test { static int Main() { // Class Test has only a default constructor, which takes no arguments. Test test1 = new Test(2); // CS1729 // The following line resolves the error. Test test2 = new Test(); // Class Parent has only one constructor, which takes two int parameters. Parent exampleParent1 = new Parent(10); // CS1729 // The following line resolves the error. Parent exampleParent2 = new Parent(10, 1); return 1; } } public class Parent { // The only constructor for this class has two parameters. public Parent(int i, int j) { } } // The following declaration causes a compiler error because class Parent // does not have a constructor that takes no arguments. The declaration of // class Child2 shows how to resolve this error. public class Child : Parent { } // CS1729 public class Child2 : Parent { // The constructor for Child2 has only one parameter. To access the // constructor in Parent, and prevent this compiler error, you must provide // a value for the second parameter of Parent. The following example provides 0. public Child2(int k) : base(k, 0) { // Add the body of the constructor here. } } ``` ## 請參閱 [繼承(C# 編程指南)](https://msdn.microsoft.com/zh-cn/library/ms173149.aspx) [構造函數(C# 編程指南)](https://msdn.microsoft.com/zh-cn/library/ace5hbzh.aspx)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看