用户在Window应用程序中选择文件 [英] File Selection by user in Window Application
本文介绍了用户在Window应用程序中选择文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我正在研究窗口应用程序.
在其中,用户将选择/浏览文件以进行进一步的操作(例如,在Web窗体中使用文件上传控件).
那么在窗口应用程序中应该使用哪个控件?
问候!
Aman
Hi All,
I am working on window applicaiton.
In which, User will Select/Browse files for further operation (like fileupload control is used in webforms).
So Which control should I use in window application?
Regards!
Aman
推荐答案
您应该使用openFileDialog控件:
msdn [
You should utilize openFileDialog control:
msdn[^] explains how to use it quite well.
试试:
OpenFileDialog ofd = new OpenFileDialog();
if (ofd.ShowDialog() == DialogResult.OK)
{
string path = ofd.FileName;
...
}
文件上传控件 [ ^ ]提供了上载内容的选项文件.
The FileUpload control [^] provides options to upload a file.
这篇关于用户在Window应用程序中选择文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文