首页 新闻 会员 周边

初学困惑之3-FilterInex使用

0
[待解决问题]

 CS1061: “System.Windows.Forms.OpenFileDialog”不包含“FilterInex”的定义,并且找不到可接受类型为“System.Windows.Forms.OpenFileDialog”的第一个参数的扩展方法“FilterInex”(是否缺少 using 指令或程序集引用?)
源错误:

 
行 24:         ofd.InitialDirectory = "e:\\"; //定义打开的默认文件夹位置
行 25:         ofd.Filter = "txt files(*.txt|*.txt|All files(*.*)|*.*";
行 26:         ofd.FilterInex = 3;
行 27:         ofd.RestoreDirectory = true;
行 28:         //if (ofd.ShowDialog() == DialogResult.ok)
                  

FilterInex 使用using后还是错误

CS0234: 命名空间“System”中不存在类型或命名空间名称“FilterInex”(是否缺少程序集引用?)
源错误:

 
行 13: using System.Windows.Forms;
行 14: using System.Windows;
行 15: using System.FilterInex;
行 16: 
行 17: public partial class Default2 : System.Web.UI.Page
                  

 我的代码:

using System.Xml.Linq;

using System.Windows.Forms;

using System.Windows;

using System.FilterInex;

public partial class Default2 : System.Web.UI.Page

{      

  protected void Button1_Click(object sender, EventArgs e)    

  {      

           OpenFileDialog ofd = new OpenFileDialog();                //new一个方法                      ofd.InitialDirectory = "e:\\"; //定义打开的默认文件夹位置        

    ofd.Filter = "txt files(*.txt|*.txt|All files(*.*)|*.*";        

    ofd.FilterInex = 3;        

    ofd.RestoreDirectory = true;

 

FilterInex 该如何引用

各位前辈,请 指点下。

天眼在线的主页 天眼在线 | 初学一级 | 园豆:196
提问于:2013-07-19 11:09
< >
分享
所有回答(1)
0

晕,web页面里调用winform的打开文件控件,为什么要这么用啊?

小兵仔 | 园豆:1240 (小虾三级) | 2013-07-19 16:56

那应该用什么控件, 在web里

支持(0) 反对(0) 天眼在线 | 园豆:196 (初学一级) | 2013-07-25 09:12

@天眼在线: <input type=file />用这个。

支持(0) 反对(0) 小兵仔 | 园豆:1240 (小虾三级) | 2013-07-25 14:30
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册