使用c#将图像上传到Web服务

编程入门 行业动态 更新时间:2024-10-21 18:32:03
本文介绍了使用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服务

本文发布于:2023-10-12 17:10:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1485345.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:图像   Web

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!