另外使用wcf时,最好不要使用using因为使用using会屏蔽掉很多错误,误导用户,参考链接:http://www.codeproject.com/Tips/197531/Do-not-use-using-for-WCF-Clients相关代码改为:usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Windows.Forms;usingSystem.ServiceModel;namespaceWcfUploadServiceHost{staticclassProgram{//////Themainentrypointfortheapplication.///[STAThread]staticvoidMain(){try{varhost=newServiceHost(typeof(WcfUploadServiceLib.UpLoadService));host.Open();Console.WriteLine("Serverisopened...");Console.Read();//using(varhost=newServiceHost(typeof(WcfUploadServiceLib.UpLoadService)))//{//host.Open();//Console.WriteLine("Serverisopened...");//Console.Read();//}}catch(Exceptionex){Console.WriteLine(ex.ToString());Console.Read();}}}}-IMDN开发者社群-imdn.cn"> 另外使用wcf时,最好不要使用using因为使用using会屏蔽掉很多错误,误导用户,参考链接:http://www.codeproject.com/Tips/197531/Do-not-use-using-for-WCF-Clients相关代码改为:usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Windows.Forms;usingSystem.ServiceModel;namespaceWcfUploadServiceHost{staticclassProgram{//////Themainentrypointfortheapplication.///[STAThread]staticvoidMain(){try{varhost=newServiceHost(typeof(WcfUploadServiceLib.UpLoadService));host.Open();Console.WriteLine("Serverisopened...");Console.Read();//using(varhost=newServiceHost(typeof(WcfUploadServiceLib.UpLoadService)))//{//host.Open();//Console.WriteLine("Serverisopened...");//Console.Read();//}}catch(Exceptionex){Console.WriteLine(ex.ToString());Console.Read();}}}} - IMDN开发者社群-imdn.cn">
登录
首页 » C# » wcf 实现大文件上传(有进度条)实例源码

wcf 实现大文件上传(有进度条)实例源码

于 2015-01-07 发布
0 210
下载积分: 1 下载次数: 0

代码说明:

部分win7/win8用户 运行时报错 可能是 权限问题,所以运行项目的时候 要右键>>以管理员身份运行 部分用户 运行该项目的时候 可能提示:协定需要双工 但是绑定 NetTcpBinding 不支持 这是只需要将host项目app.config中协议部分 改为wsDualHttpBinding 即可,如下代码: 另外使用wcf时,最好不要使用 using 因为使用using会屏蔽掉很多错误,误导用户,参考链接:http://www.codeproject.com/Tips/197531/Do-not-use-using-for-WCF-Clients 相关代码改为:using System;using System.Collections.Generic;using System.Linq;using System.Windows.Forms;using System.ServiceModel;namespace WcfUploadServiceHost{ static class Program { /// /// The main entry point for the application. /// [STAThread] static void Main() { try { var host = new ServiceHost(typeof (WcfUploadServiceLib.UpLoadService)); host.Open(); Console.WriteLine("Server is opened..."); Console.Read(); //using (var host = new ServiceHost(typeof(WcfUploadServiceLib.UpLoadService))) //{ // host.Open(); // Console.WriteLine("Server is opened..."); // Console.Read(); //} } catch (Exception ex) { Console.WriteLine(ex.ToString()); Console.Read(); } } }}

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • DownLoad
    基于HTTP协议的支持断点续传的下载软件源码(HTTP protocol support for HTTP-based download software source)
    2013-03-27 16:54:24下载
    积分:1
  • IPPackCap
    编制程序,监控网络,捕获一段时间内网络上的IP数据包,按IP数据包的源地址统计出该源地址在该时间段内发出的IP包的个数,将其写入日志文件中或用图形表示出来(建议用图形表示出统计结果)。(Program monitoring network, a period of time to capture IP data packets on the network, according to the source address of the IP packet statistics of the number of the source address is issued in the time of the IP package, written into the log file or graph out (that show the statistical results with graphics).)
    2021-01-11 17:18:49下载
    积分:1
  • WiseSocket
    简化Sock连接。采用队列保存Sock的收发消息包,保证消息的处理顺序。(Simplify the Sock connection)
    2012-05-28 11:19:06下载
    积分:1
  • download
    该软件可以从互联网上下载文件...但是速度不快,,而且有时会下载失败(The software can download a file from the Internet ... but slow, and sometimes fail to download)
    2007-12-13 13:03:23下载
    积分:1
  • signal-protocol
    各种协议的讲解,是初学的好资料。 各种协议的讲解,是初学的好资料。 (Explain the various agreements is a good beginner information. Explain the various agreements is a good beginner information.)
    2008-07-22 19:56:38下载
    积分:1
  • C#调用SMTP发送文本内容,发邮件实例源码
    C#调用SMTP发送文本内容,详见示例图
    2013-01-24下载
    积分:1
  • UDPTest
    UDP协议测试工具,可根据设定绑定UDP绑定IPD端口,进行相关的UDP吸引收发数据测试。(UDP protocol test tools, according to the set bound to the UDP binding IPD port, the UDP attract send and receive data test.)
    2013-04-18 09:18:39下载
    积分:1
  • 1234
    轻松获得计算机网络接口信息的一个软件。记忆visual c++(Easy access to information on a computer network interface software. Memory visual c++)
    2011-07-22 16:40:46下载
    积分:1
  • C#远程桌面管理工具源码
    C#实现远程桌面连接
    2019-02-27下载
    积分:1
  • 基于噪声点检测的中值滤波方法_马学磊
    图像识别中,对噪点的检测的中值滤波的方法。(Image recognition, median filtering method for the noise detection)
    2017-07-06 16:20:55下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载