如何申请的OpenFileDialog功能,以web应用 [英] How to Apply OpenFileDialog Function to a WebApplication

查看:283
本文介绍了如何申请的OpenFileDialog功能,以web应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我devoloping一个Web应用程序,其中一个页面有一些neccessity的用户应该在系统和前选择任意文件夹,如果他选择例如:D:\ XYZ,那么这个路径应该在数据库中保存的,我有写在code,用于存储到数据库和剩余的每一件事情。但实际上我认为,如果它就像一个浏览按钮点击功能选择文件夹,我所做出的,因为我不知道如何使它在Web应用程序简单,我用一个文本框,以便能够用户键入路径。可以,任何一个可以帮助我如何申请打开文件对话框的功能在网页中?

I am devoloping a Web Application, in which one Page has some neccessity that User should select any folder in the System and for ex if he selects ex:D:\xyz, then this Path should be Saved in Database, I have written the Code for Storing in to Database and Remaining Every thing. But actually i think that if it is like a Browse Button click function to select the Folder, what i have made is, as i dont know how to make it in Web Application simply i used a textbox to be able to user to type the Path. Can, any one help me how to apply the Open File Dialog Functionality in a Web Page?

在此先感谢,

问候 格利扬。

推荐答案

没有ASP.Net控制来选择文件夹。

There is no ASP.Net Control to select folders.

作为一个简单的解决方法,你可以使用文件上传 - 控制,让用户选择一个文件,你可以的保存文件的文件夹中。但是,这将仅适用于IE浏览器,因为其他浏览器没有发布完整的文件路径,但只有文件名(安全限制)。

As a simple workaround you could use the FileUpload-Control to let the user select a file and you can save the folder of that file. But that would work only in IE because other browsers don't post the full file-path but only the file-name(security restrictions).

编辑:正如本·提到,这并不在IE浏览器> 7两种: <一href="http://blogs.msdn.com/b/ie/archive/2008/07/02/ie8-security-part-v-com$p$phensive-protection.aspx" rel="nofollow">http://blogs.msdn.com/b/ie/archive/2008/07/02/ie8-security-part-v-com$p$phensive-protection.aspx (第文件上传控件

As Ben mentioned that doesn't work in IE>7 either: http://blogs.msdn.com/b/ie/archive/2008/07/02/ie8-security-part-v-comprehensive-protection.aspx (section File Upload Control)

这篇关于如何申请的OpenFileDialog功能,以web应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆