質問

I am struggling to find a solution where i need the web user to be able to select a file from their local directory, in order for me to process it. I have already set up the processing code, so just need to get the target file identified and then moved to the web server.

It would appear my answer resides in the following article http://msdn.microsoft.com/en-us/library/system.windows.controls.openfiledialog(v=vs.95).aspx

However, i am reciving the following compiler error: BC30466: Namespace or type 'Controls' for the Imports 'System.Windows.Controls' cannot be found.

Any help appreciated.

Barry

役に立ちましたか?

解決

This would be completely wrong, you can't use a desktop application component on a web form. Instead, put the

<asp:FileUpload runat="server" ... />

on your form. This renders as input of type "file" at the client side and lets your clients post files to the server.

Consult the documentation for more details

http://msdn.microsoft.com/en-us/library/aa479405.aspx

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top