• <legend id='Um3Sk'><style id='Um3Sk'><dir id='Um3Sk'><q id='Um3Sk'></q></dir></style></legend>
    <i id='Um3Sk'><tr id='Um3Sk'><dt id='Um3Sk'><q id='Um3Sk'><span id='Um3Sk'><b id='Um3Sk'><form id='Um3Sk'><ins id='Um3Sk'></ins><ul id='Um3Sk'></ul><sub id='Um3Sk'></sub></form><legend id='Um3Sk'></legend><bdo id='Um3Sk'><pre id='Um3Sk'><center id='Um3Sk'></center></pre></bdo></b><th id='Um3Sk'></th></span></q></dt></tr></i><div id='Um3Sk'><tfoot id='Um3Sk'></tfoot><dl id='Um3Sk'><fieldset id='Um3Sk'></fieldset></dl></div>

  • <tfoot id='Um3Sk'></tfoot>

    <small id='Um3Sk'></small><noframes id='Um3Sk'>

      <bdo id='Um3Sk'></bdo><ul id='Um3Sk'></ul>

      1. 使用类文件/引用它?

        Using a class file/reference it?(使用类文件/引用它?)
          <tbody id='ubgrw'></tbody>
          <bdo id='ubgrw'></bdo><ul id='ubgrw'></ul>
        • <i id='ubgrw'><tr id='ubgrw'><dt id='ubgrw'><q id='ubgrw'><span id='ubgrw'><b id='ubgrw'><form id='ubgrw'><ins id='ubgrw'></ins><ul id='ubgrw'></ul><sub id='ubgrw'></sub></form><legend id='ubgrw'></legend><bdo id='ubgrw'><pre id='ubgrw'><center id='ubgrw'></center></pre></bdo></b><th id='ubgrw'></th></span></q></dt></tr></i><div id='ubgrw'><tfoot id='ubgrw'></tfoot><dl id='ubgrw'><fieldset id='ubgrw'></fieldset></dl></div>
        • <tfoot id='ubgrw'></tfoot>

            <small id='ubgrw'></small><noframes id='ubgrw'>

            1. <legend id='ubgrw'><style id='ubgrw'><dir id='ubgrw'><q id='ubgrw'></q></dir></style></legend>

                  本文介绍了使用类文件/引用它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  如果你使用你的程序集引用 (myExample.dll),你可以像这样添加到顶部

                  If you use a you assembly reference (myExample.dll), you add like this to the top

                  using myExample;
                  

                  现在如果你创建一个类文件,你如何引用它?

                  Now if you create a class file, how do you reference it?

                  推荐答案

                  好吧,在你的类文件中,你有以下内容:

                  Well, in your class file you have the following:

                  namespace myNamespace
                  {
                      public class MyClass
                      {
                          public void MyMethod() { }
                      }
                  }
                  

                  假设您在名为 MyDll.dll 的程序集中拥有它.您可以按如下方式使用它:

                  Let's assume that you have this in an assembly named MyDll.dll. You'd use it as follows:

                  1. 您在解决方案资源管理器中添加对 MyDll.dll 的引用
                  2. 您将命名空间包含在 using myNamespace;
                  3. 然后你可以使用你的类做 MyClass test = new MyClass();

                  如果你不像我在 2. 中所说的那样添加命名空间,你会像这样使用你的类:

                  If you don't add the namespace like I said in 2., you'd use your class like:

                  myNamespace.MyClass test = new myNamespace.MyClass();
                  

                  这篇关于使用类文件/引用它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  C# namespace alias - what#39;s the point?(C# 命名空间别名 - 有什么意义?)
                  Using Xpath With Default Namespace in C#(在 C# 中使用具有默认命名空间的 Xpath)
                  IBM.Data.DB2.Core connection problems(IBM.Data.DB2.Core 连接问题)
                  Generating an EDMX from a DB2 Database(从 DB2 数据库生成 EDMX)
                  Datetime field overflow with IBM Data Server Client v9.7fp5(IBM Data Server Client v9.7fp5 的日期时间字段溢出)
                  IBM .NET Data Provider Connection String issue with Library List(库列表的 IBM .NET 数据提供程序连接字符串问题)

                  <small id='Mxyo8'></small><noframes id='Mxyo8'>

                    <legend id='Mxyo8'><style id='Mxyo8'><dir id='Mxyo8'><q id='Mxyo8'></q></dir></style></legend>
                  1. <tfoot id='Mxyo8'></tfoot>

                          <bdo id='Mxyo8'></bdo><ul id='Mxyo8'></ul>

                              <tbody id='Mxyo8'></tbody>
                            <i id='Mxyo8'><tr id='Mxyo8'><dt id='Mxyo8'><q id='Mxyo8'><span id='Mxyo8'><b id='Mxyo8'><form id='Mxyo8'><ins id='Mxyo8'></ins><ul id='Mxyo8'></ul><sub id='Mxyo8'></sub></form><legend id='Mxyo8'></legend><bdo id='Mxyo8'><pre id='Mxyo8'><center id='Mxyo8'></center></pre></bdo></b><th id='Mxyo8'></th></span></q></dt></tr></i><div id='Mxyo8'><tfoot id='Mxyo8'></tfoot><dl id='Mxyo8'><fieldset id='Mxyo8'></fieldset></dl></div>