简体   繁体   中英

How do I add a browse file system button to a Visual Studio app?

I am looking to add a browse button to a visual studio app something simular to the the dialog box in the 'fileupload' tool. I am looking to be able to graphically select any file from my computer or a computer across a network.

There is a FileUpload control...

http://www.dotnet-webhosting.com/aspnet-2-0-tutorials/asp-net-2-0-fileupload.aspx

Otherwise, the SWF uploader is very popular if you want something richer: http://www.swfupload.org/

EDIT:

The OpenFileDialog is a WinForms control and there is no equivalent in ASP.NET. When using a FileUpload the browser knows to provide you with a file picker to browse your local system. There is no way to replicate this behaviour with some type of local ActiveX control. This is a natural and deliberate limitation of the web, the application should not be able to access your local file system apart from in exceptional and well-defined circumstances.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM