使用c#将图像上传到Web服务 [英] upload image to web service using c#

查看:94
本文介绍了使用c#将图像上传到Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个Windows移动应用程序,用于将图像上传到web服务并使用c#从webservice检索图像。

我的webservices包含两种方法......



I am developing a windows mobile application for uploading a image to webservice and retrieving the image from webservice by using c#.
my webservices contain two methods they are...

[WebMethod]
public byte[] imageToByteArray(System.Drawing.Image imageIn)
{
MemoryStream ms = new MemoryStream();
imageIn.Save(ms, System.Drawing.Imaging.ImageFormat.Gif);
return ms.ToArray();
}
[WebMethod]
public Image byteArrayToImage(byte[] byteArrayIn)
{
MemoryStream ms = new MemoryStream(byteArrayIn);
Image returnImage = Image.FromStream(ms);
return returnImage;
}



在我的应用程序中有一个图片框和两个用于上传和下载的按钮。

我还添加了对webservices的引用。我不知道上传和下载图片的上传n下载按钮代码是什么。

帮帮我..



代码包含在pre标签中[/ edited]

推荐答案

除了Abhinav的回答你还可以去那里 - [通过C#Web服务上传任何类型的文件] [ ^ ]
In addition to Abhinav answer you can also go there-[Upload any type of File through a C# Web Service][^]


[ ^ ]文章可能对您有帮助。
This[^] article might help you.


这个 [ ^ ]文章也可以帮助你。
this[^] article might also help you.


这篇关于使用c#将图像上传到Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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