C# windows 应用程序中的文件上传 [英] File Upload in C# windows Application
本文介绍了C# windows 应用程序中的文件上传的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的 C# Windows 应用程序中,我想上传一个 pdf 文件,但在我的工具箱中我找不到 FileUpload 控件.
In my C# Windows application I want to upload a pdf file but in my toolbox I cannot find a FileUpload control.
如何在 C# windows 应用程序中上传 pdf 文件?
How can I go about and uploading a pdf file in a C# windows application.?
问候
推荐答案
在窗体上放置 OpenFileDialog 控件后,假设您单击一个按钮并:
After you put a OpenFileDialog control on your form, let's say that you click a button and:
private void button1_Click(object sender, EventArgs e)
{
DialogResult result = openFileDialog1.ShowDialog();
if (result == DialogResult.OK) // Test result.
{
//Do whatever you want
//openFileDialog1.FileName .....
}
}
事情是这样的:-)
这篇关于C# windows 应用程序中的文件上传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文