1、新建Web项目,命名weixin

2、在weixin项目中添加WebService,命名为weixin.asmx

3、百度云盘下载组件:https://pan.baidu.com/s/1c2LC3vy
4、添加引用SaveFileFromHttp

5、 [WebMethod] public string SaveImage() { string value = ""; try { SaveFileFromHttp cls = new SaveFileFromHttp(); string imageName = "test.jpg"; string path = "/Images/" + imageName; cls.SaveImageByInPutStream(imageName,path); value += "成功"; } catch (Exception er) { value = "失败:" + er.Message; } return (value); }
6、微信端直接引用url(例:https://www.baidu.com/weixin.asmx/SaveImage)即可