如何从FTP服务器获取jpg图像并使用C#在PictureBox中显示 [英] How to fetch jpg image from FTP server and show in PictureBox using C#

查看:416
本文介绍了如何从FTP服务器获取jpg图像并使用C#在PictureBox中显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



提前致谢。



我想告诉你我已经谷歌相同,但我无法找到写代码。



我已成功上传jpg图像文件在服务器上。现在在Show按钮上单击事件我想在PictureBox上显示该文件。



为了更好地理解,让我们举例说明我存储了10个图像,名称从0.jpg到9.jpg。



在窗口我有3个控件,文本框,显示按钮和图片框。



当我在文本框中键入0.jpg,然后单击显示按钮时,存储在ftp服务器上的0.jpg应该显示在图片框中。



我希望你理解我的任务。请指导我如何做到。

Hello ,

Thanks in advance.

I would like to tell you I have already googled for same but I am unable to find write code.

I have uploaded jpg image file on server successfully. Now on Show button click event I want to show that file on PictureBox.

For better understanding, lets take example I have stored 10 images with names from 0.jpg to 9.jpg .

On window I have 3 controls , text box , show button and picture box.

When I type 0.jpg in text box, and click on show button 0.jpg stored at ftp server should be shown in picture box.

I hope you have understood my task. Please guide me how I can do it.

推荐答案

您只需要使用类 FtpWebRequest :< a href =https://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest%28v=vs.110%29.aspx> https://msdn.microsoft.com/en-us /library/system.net.ftpwebrequest%28v=vs.110%29.aspx [ ^ ]。



-SA
All you need is to use the class FtpWebRequest: https://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest%28v=vs.110%29.aspx[^].

—SA


有很多像CHILKAT这样的第三方dll可用于FTP或SFTP上传。

它们使用起来非常简单。您只需在项目中添加dll即可使用。



-GS
there are many 3rd party dll like CHILKAT is available for FTP or SFTP upload.
They are very simple to use. You can use as per your requirement just by adding dll in your project.

-GS


这篇关于如何从FTP服务器获取jpg图像并使用C#在PictureBox中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆