本文介绍了使用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]
推荐答案
这篇关于使用c#将图像上传到Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!