• 大小: 0.03M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2020-12-14
  • 语言: C#
  • 标签: WCF  上传  C#  文件  下载  

资源简介

如您在本机测试的时候 切记 

1.运行的时候 以 管理员身份运行

2.将Client项目中的 ip地址 192.168.1.8 改成你本机ip或者localhost

资源截图

代码片段和文件信息

#coding:utf-8
import requests

requests.post(“http://192.168.1.8:9000/receiveimg“open(“d:\\4.jpg““rb“))
print(‘上传图片完成‘)

requests.post(“http://192.168.1.8:9000/receiveimage/22“open(“d:\\4.jpg““rb“))

print(‘上传图片完成(带指定文件名)‘)

import shutil

res = requests.get(“http://192.168.1.8:9000/readimg“stream=True)
with open(‘d:\\download.jpg‘‘wb‘) as outfile:
    shutil.copyfileobj(res.raw outfile)

del res

print(‘图片下载完成‘)

filename = “penguins.jpg“;
res = requests.get(“http://192.168.1.8:9000/readimage/“+ filenamestream=True)
with open(‘d:\\‘+ filename‘wb‘) as outfile:
    shutil.copyfileobj(res.raw outfile)

del res

print(‘图片下载完成(带指定文件名)‘)


 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2014-10-03 11:36  WcfBinaryRestful-master\
     文件        2518  2014-10-03 11:36  WcfBinaryRestful-master\.gitattributes
     文件        2233  2014-10-03 11:36  WcfBinaryRestful-master\.gitignore
     目录           0  2014-10-03 11:36  WcfBinaryRestful-master\PythonClientDemo\
     文件         690  2014-10-03 11:36  WcfBinaryRestful-master\PythonClientDemo\PythonClientDemo.py
     文件        1203  2014-10-03 11:36  WcfBinaryRestful-master\PythonClientDemo\PythonClientDemo.pyproj
     目录           0  2014-10-03 11:36  WcfBinaryRestful-master\PythonToolslinks1\
     文件        4060  2014-10-03 11:36  WcfBinaryRestful-master\PythonToolslinks1\PythonTools.html
     文件         807  2014-10-03 11:36  WcfBinaryRestful-master\PythonToolslinks1\PythonToolslinks1.csproj
     文件        4424  2014-10-03 11:36  WcfBinaryRestful-master\PythonToolslinks1\vslogo.png
     目录           0  2014-10-03 11:36  WcfBinaryRestful-master\WcfBinaryRestful.Client\
     文件        3895  2014-10-03 11:36  WcfBinaryRestful-master\WcfBinaryRestful.Client\Form1.Designer.cs
     文件        3465  2014-10-03 11:36  WcfBinaryRestful-master\WcfBinaryRestful.Client\Form1.cs
     文件        5698  2014-10-03 11:36  WcfBinaryRestful-master\WcfBinaryRestful.Client\Form1.resx
     文件         483  2014-10-03 11:36  WcfBinaryRestful-master\WcfBinaryRestful.Client\Program.cs
     目录           0  2014-10-03 11:36  WcfBinaryRestful-master\WcfBinaryRestful.Client\Properties\
     文件        1344  2014-10-03 11:36  WcfBinaryRestful-master\WcfBinaryRestful.Client\Properties\AssemblyInfo.cs
     文件        2827  2014-10-03 11:36  WcfBinaryRestful-master\WcfBinaryRestful.Client\Properties\Resources.Designer.cs
     文件        5496  2014-10-03 11:36  WcfBinaryRestful-master\WcfBinaryRestful.Client\Properties\Resources.resx
     文件        1080  2014-10-03 11:36  WcfBinaryRestful-master\WcfBinaryRestful.Client\Properties\Settings.Designer.cs
     文件         242  2014-10-03 11:36  WcfBinaryRestful-master\WcfBinaryRestful.Client\Properties\Settings.settings
     文件        3676  2014-10-03 11:36  WcfBinaryRestful-master\WcfBinaryRestful.Client\WcfBinaryRestful.Client.csproj
     目录           0  2014-10-03 11:36  WcfBinaryRestful-master\WcfBinaryRestful.Contracts\
     文件         845  2014-10-03 11:36  WcfBinaryRestful-master\WcfBinaryRestful.Contracts\IService.cs
     目录           0  2014-10-03 11:36  WcfBinaryRestful-master\WcfBinaryRestful.Contracts\Properties\
     文件        1341  2014-10-03 11:36  WcfBinaryRestful-master\WcfBinaryRestful.Contracts\Properties\AssemblyInfo.cs
     文件        3063  2014-10-03 11:36  WcfBinaryRestful-master\WcfBinaryRestful.Contracts\WcfBinaryRestful.Contracts.csproj
     目录           0  2014-10-03 11:36  WcfBinaryRestful-master\WcfBinaryRestful.Host\
     文件        1164  2014-10-03 11:36  WcfBinaryRestful-master\WcfBinaryRestful.Host\App.config
     文件         562  2014-10-03 11:36  WcfBinaryRestful-master\WcfBinaryRestful.Host\Host.cs
     目录           0  2014-10-03 11:36  WcfBinaryRestful-master\WcfBinaryRestful.Host\Properties\
............此处省略8个文件信息

评论

共有 条评论