文件选择对话框 [英] File Selection Dialog
本文介绍了文件选择对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们如何调用文件选择对话框?我想在ASP.net中的C#
中执行此操作。我想打开一个文件进行阅读。
马拉松运动员
解决方案
OpenFileDialog?
" marathoner" < ra ****** @ msn.com.invalidwrote in message
news:ed ************** @ TK2MSFTNGP02.phx.gbl .. 。
我们如何调用文件选择对话框?我想在ASP.net中的C#
中执行此操作。我想打开一个文件进行阅读。
Marathoner
要使用OpenFileDialog,我需要使用命名空间System.Windows.Forms。
它不允许我在ASP.net中使用这个命名空间。我得到以下
错误消息:
错误CS0234:
$中不存在类型或命名空间名称''Windows'' b $ b namespace''System''(你错过了一个程序集引用吗?)
Marathoner
" Ignacio Machin(.NET / C#MVP) < machin TA laceupsolutions.com写在
消息新闻:u7 **************** @ TK2MSFTNGP06.phx.gbl ...
< blockquote class =post_quotes>
OpenFileDialog?
" marathoner" < ra ****** @ msn.com.invalidwrote in message
news:ed ************** @ TK2MSFTNGP02.phx.gbl .. 。
>我们如何调用文件选择对话框?我想在ASP.net中的C#中这样做。我想打开一个文件进行阅读。
Marathoner
marathoner写道:
我们如何调用文件选择对话框?我想在ASP.net中的C#
中执行此操作。我想打开一个文件进行阅读。
您是否希望能够选择然后上传文件?如果是这样,请使用
FileUpload控件。请参阅
http://msdn2.microsoft.com /en-us/library/ms227669.aspx 了解更多关于
如何使用该控件的信息。
-
汤姆波特菲尔德
How do we invoke the file selection dialog? I would like to do this in C#
in ASP.net. I would like to open a file for reading.
Marathoner
解决方案
Hi,
OpenFileDialog ?
"marathoner" <ra******@msn.com.invalidwrote in message
news:ed**************@TK2MSFTNGP02.phx.gbl...How do we invoke the file selection dialog? I would like to do this in C#
in ASP.net. I would like to open a file for reading.
Marathoner
To use OpenFileDialog, I need to use the namespace "System.Windows.Forms".
It doesn''t allow me to use this namespace in ASP.net. I get the following
error message:
error CS0234: The type or namespace name ''Windows'' does not exist in the
namespace ''System'' (are you missing an assembly reference?)
Marathoner
"Ignacio Machin ( .NET/ C# MVP )" <machin TA laceupsolutions.comwrote in
message news:u7****************@TK2MSFTNGP06.phx.gbl...Hi,
OpenFileDialog ?
"marathoner" <ra******@msn.com.invalidwrote in message
news:ed**************@TK2MSFTNGP02.phx.gbl...>How do we invoke the file selection dialog? I would like to do this in
C# in ASP.net. I would like to open a file for reading.
Marathoner
marathoner wrote:How do we invoke the file selection dialog? I would like to do this in C#
in ASP.net. I would like to open a file for reading.Are you wanting the ability to select and then upload a file? If so, use
the FileUpload control. See
http://msdn2.microsoft.com/en-us/library/ms227669.aspx for more info on how
to use the control.
--
Tom Porterfield
这篇关于文件选择对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文