<legend id='LPZ88'><style id='LPZ88'><dir id='LPZ88'><q id='LPZ88'></q></dir></style></legend>
  1. <tfoot id='LPZ88'></tfoot>
      <bdo id='LPZ88'></bdo><ul id='LPZ88'></ul>

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

    1. <i id='LPZ88'><tr id='LPZ88'><dt id='LPZ88'><q id='LPZ88'><span id='LPZ88'><b id='LPZ88'><form id='LPZ88'><ins id='LPZ88'></ins><ul id='LPZ88'></ul><sub id='LPZ88'></sub></form><legend id='LPZ88'></legend><bdo id='LPZ88'><pre id='LPZ88'><center id='LPZ88'></center></pre></bdo></b><th id='LPZ88'></th></span></q></dt></tr></i><div id='LPZ88'><tfoot id='LPZ88'></tfoot><dl id='LPZ88'><fieldset id='LPZ88'></fieldset></dl></div>
    2. 'System.Windows.Forms.FolderBrowserDialog' 是一种类型而不是命

      #39;System.Windows.Forms.FolderBrowserDialog#39; is a type not a namespace(System.Windows.Forms.FolderBrowserDialog 是一种类型而不是命名空间)
      1. <small id='9T5Nh'></small><noframes id='9T5Nh'>

        <tfoot id='9T5Nh'></tfoot>

            <tbody id='9T5Nh'></tbody>
              <i id='9T5Nh'><tr id='9T5Nh'><dt id='9T5Nh'><q id='9T5Nh'><span id='9T5Nh'><b id='9T5Nh'><form id='9T5Nh'><ins id='9T5Nh'></ins><ul id='9T5Nh'></ul><sub id='9T5Nh'></sub></form><legend id='9T5Nh'></legend><bdo id='9T5Nh'><pre id='9T5Nh'><center id='9T5Nh'></center></pre></bdo></b><th id='9T5Nh'></th></span></q></dt></tr></i><div id='9T5Nh'><tfoot id='9T5Nh'></tfoot><dl id='9T5Nh'><fieldset id='9T5Nh'></fieldset></dl></div>
            1. <legend id='9T5Nh'><style id='9T5Nh'><dir id='9T5Nh'><q id='9T5Nh'></q></dir></style></legend>
                <bdo id='9T5Nh'></bdo><ul id='9T5Nh'></ul>

                本文介绍了'System.Windows.Forms.FolderBrowserDialog' 是一种类型而不是命名空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我可能遗漏了一些非常明显的东西,但现在我看不到了.我有对 System.Windows.Forms 的引用,并且我有下一个 using 类:

                It is possible that I'm missing something very obvious but now I can not see now. I have the reference to System.Windows.Forms and I have the next using classes:

                using System;
                using System.Collections.Generic;
                using System.Linq;
                using System.Text;
                using System.Windows;
                using System.Windows.Controls;
                using System.Windows.Data;
                using System.Windows.Documents;
                using System.Windows.Input;
                using System.Windows.Media;
                using System.Windows.Media.Imaging;
                using System.Windows.Navigation;
                using System.Windows.Shapes;
                using System.IO;
                
                using System.Windows.Forms;
                using System.Windows.Forms.FolderBrowserDialog;
                

                但是编译器总是给我下一个错误:

                But the compiler always give to me the next error:

                错误 CS0138:使用命名空间指令只能应用于命名空间;'System.Windows.Forms.FolderBrowserDialog' 是一种类型而不是命名空间

                error CS0138: A using namespace directive can only be applied to namespaces; 'System.Windows.Forms.FolderBrowserDialog' is a type not a namespace

                推荐答案

                你做不到

                using System.Windows.Forms.FolderBrowserDialog;
                

                因为它一个类型而不是一个命名空间.它所属的命名空间是System.Windows.Forms.删除这一行,如果你想实例化一个 FolderBrowserDialog 并确保你有这一行

                as it is a type and not a namespace. The namespace it belongs to is System.Windows.Forms. Remove this line and if you want to instantiate a FolderBrowserDialog and just make sure you have the line

                using System.Windows.Forms;
                

                并像这样制作一个 FolderBrowserDialog:

                var fbd = new FolderBrowserDialog();
                

                <小时>

                所有这一切都与 Java 形成对比,在 Java 中您导入类型而不是使用命名空间,这可能是您出错的地方 - 在 Java 中您会执行以下操作:


                All this is in contrast to Java, where you import types not use namespaces, which is where you may be going wrong - in Java you would do something like:

                import System.Windows.Forms.FolderBrowserDialog;
                

                然后就可以使用了.

                这篇关于'System.Windows.Forms.FolderBrowserDialog' 是一种类型而不是命名空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                C# namespace alias - what#39;s the point?(C# 命名空间别名 - 有什么意义?)
                Using Xpath With Default Namespace in C#(在 C# 中使用具有默认命名空间的 Xpath)
                Generating an EDMX from a DB2 Database(从 DB2 数据库生成 EDMX)
                IBM .NET Data Provider Connection String issue with Library List(库列表的 IBM .NET 数据提供程序连接字符串问题)
                .NET DB2 OLEDB pre-requisites(.NET DB2 OLEDB 先决条件)
                Referring to Code in IBM.Data.DB2 makes that Assembly Unavailable to the rest of my Solution(引用 IBM.Data.DB2 中的代码使该程序集对我的解决方案的其余部分不可用)

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

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