host程序一直在运行,传一次增加一次,不见减少,是什么原因呢。做的是一个上传DEMO,客户端是网页,接到上传,从inputstream中读出字节数组,传入服务器端。
然后服务器端保存到硬盘。
clientbyte[] b=new byte[file.ContentLength];
file.InputStream.Read(b,0,b.Length);DateTime Start = DateTime.Now;
UploadService.Service1Client proxy = new UploadService.Service1Client();
proxy.Upload(b,file.FileName);Response.Write("<br />开始时间:" + Start);
Response.Write("<br />结束时间:" + DateTime.Now);
service
public int Upload(byte[] file, string fileName)
        {
            try
            {
                System.IO.File.WriteAllBytes("e:/wcfuploadtest/" + fileName, file);
            }
            catch
            {
                return -1;
            }
            return 1;
        }