另外使用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 120
下载积分: 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 个回复

  • gofk
    说明:  c语言编的词法分析器,可以学习的源码,不错(C language of lexical analyzer, you can learn the source code, good)
    2018-12-25 21:44:27下载
    积分:1
  • CHAT
    局域网聊天软件,可多人在线,具有文件传输功能和各部分代码解释,在线好友有好友列表可见(LAN chat software, online multiplayer, with file transfer capabilities and explain each part of the code, online friends have seen Buddy List)
    2013-06-30 10:54:23下载
    积分:1
  • UDPRecieveDLL
    UDP 接收数据类,里面有个接收UDP数据的线程。 我自己使用的,可靠的,已经编成DLL了,其中有些解析二进制流的代码,可以不看。(udp socket program , focus on recieve udp data.)
    2012-03-08 10:04:31下载
    积分:1
  • kdcxcs2
    快递发送单查询通信, 利用了socket(Courier to send single query communication using a socket)
    2013-01-04 19:39:10下载
    积分:1
  • dde-server-mfc-application
    一个小型的DDE服务器,可以拿来练手和学习(A small DDE server that can be used for hands-on training and learning)
    2020-06-19 02:40:01下载
    积分:1
  • c_mail
    c写的邮件例子简单方便适合初学者学习方便使用(c write the message is simple and convenient example of user-friendly for beginners to learn)
    2007-10-29 08:08:15下载
    积分:1
  • socket_src
    Socket编程指南及示例程序 Socket编程指南及示例程序(Socket Programming Guide and sample programs Socket Programming Guide and sample programs)
    2008-08-10 15:51:09下载
    积分:1
  • vcwangluobiancheng
    说明:  vc网络编程全解析,多个源码,全部为vc6打开,每个章节的源码例程都包括在里面,很好的东西,供大家学习应用 (vc network programming full resolution, multiple source, all the vc6 open source routines for each chapter are included in it, very good, for everybody to learn application)
    2010-04-03 21:35:29下载
    积分:1
  • curl
    说明:  libcurl http 与ftp文件上传代码(libcurl http and ftp upload file code)
    2019-12-09 17:21:22下载
    积分:1
  • MY_ping_command(1)
    Visual C++ 平台下实现ping命令过程,包括打包发送接受解包等 对网络编程初期学习者很有帮助
    2011-04-23 12:55:18下载
    积分:1
  • 696518资源总数
  • 105559会员总数
  • 1今日下载