本文介绍了使用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服务
发布评论