c# - 在 asp.net 中单击按钮浏览到文件

标签 c# asp.net directory-browsing

我想在单击按钮时浏览到文件夹并选择该文件夹中的文件。当用户选择特定文件时。我想检索该文件的文件夹路径和大小?

我怎样才能用c#在asp.net中做到这一点

顺便说一句,我使用的是 vs2008。

请帮助我

感谢期待

最佳答案

为什么不使用 FileUpload 控件而不是 Button? http://asp.net-tutorials.com/controls/file-upload-control/

Using FileUpload control, it will accept file uploads from users and is extremely easy. With the FileUpload control, it can be done with a small amount of lines of code, as you will see in the following example. However, please notice that there are security concerns to to consider when accepting files from users!

关于c# - 在 asp.net 中单击按钮浏览到文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5848214/

相关文章:

c# - 在 DataGrid.ItemsSource 更改后保持对一行的关注

c# - 如果我使用 OWIN Startup.cs 类并将所有配置移到那里,我是否需要 Global.asax.cs 文件?

c# - ASP.NET GridView : How to edit and delete data records

php - 有没有办法只使用 glob() 文件?

javascript - 如何实现文件导航? (意思是侧面的目录浏览)

c# - 如何在 log4net 中为多个 Logger 使用 1 个 FileAppender

c# - .net 最小化 ssl 握手数据流量

c# - 如何在运行时访问(或生成)NHibernate Sql

javascript - 如何在 asp.net 中使用 Javascript 永久禁用按钮?

c# - 限制 HttpModule 只处理某些请求