如何在c#中上传Windows窗体中的图像

问题描述:

如何在asp.net windows窗体中使用图片上传类型选项c#。

和我们这样做的网页表单将文件保存在一个文件夹中..所以我们可以这样做它也是windows形式或者在Windows窗体中我们只能存储到数据库??

how to use image upload type option in asp.net windows form c#.
and as we do it web forms saving images in a folder.. so can we do it it windows form too or in windows form we can only store to database??

我通过搜索代码项目找到了这篇文章的关键字:上传图片c# 。本文中的信息可能有助于您入门。



上传图像并在UI页面上显示 [ ^ ]



您可以编写程序来将图像存储在文件夹或数据库中。
I found this article by searching Code Project with the keywords: upload image c#. Information in this article may help get you started.

Uploading an Image and Displaying It on the UI Page[^]

You can code your program to store an image in a folder or in a database.


在WinForm中,您可以使用 OpenFileDialog [ ^ ]浏览文件然后你可以使用 File.Copy [ ^ ]将文件复制到另一个位置

检查此SO答案示例代码 [ ^ ]
in WinForm you can use OpenFileDialog [^] to browse the file and then you can use File.Copy[^] to copy the file to another location
Check this SO Answer for sample code[^]