gsoap c++ 通过WebService(asp.net)上传文件

来源:互联网 发布:手机淘宝整点购买技巧 编辑:程序博客网 时间:2024/05/07 10:32
1.

Web Service端代码:

[WebMethod]        public void GetFileNew(string str)        {            GetFiles.AcceptFile(str);        }

2

重新在Web Service端添加一个类文件命名为GetFiles,代码如下:

static public void AcceptFile(string str)        {                            string path = "C:\\Down\\" + "g" + ".jpg";                FileStream fStream = new FileStream(path, FileMode.Create, FileAccess.Write);                byte[] result=System.Text.Encoding.Default.getBytes(str);                fStream.Write(result, 0, str.Length);                fStream.Close();                    }

客户端仿照下面所写和参照http://blog.csdn.net/g710710/article/details/6834384(fopen fread memset使用)

http://www.cnblogs.com/wangshuai/archive/2009/12/29/1634961.html

原创粉丝点击