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

  • UDPMultiRecv
    UDP Server M multi users
    2014-12-30 19:51:52下载
    积分:1
  • chat
    一个mfc聊天程序,是使用Csock类,服务端和客户端相互通信(A MFC chat program, using the Csock class, servers and clients communicate with each other)
    2018-12-22 22:43:21下载
    积分:1
  • gofk
    c语言编的词法分析器,可以学习的源码,不错(C language of lexical analyzer, you can learn the source code, good)
    2018-12-25 21:44:27下载
    积分:1
  • TCP
    TCP通信示例程序,很好用的网络通信例程(TCP communication sample program, the good network communication routines)
    2014-03-14 11:25:31下载
    积分:1
  • Chat
    在VS2005的编程环境下,利用套接字的编程原理,可以实现网络聊天功能。(On the basic of VS2005, take advantage of the principle of Socket to achieve the ability to communicate online.)
    2014-04-11 09:18:47下载
    积分:1
  • Router
    手写路由,使用C++模拟路由的过程,包括ARP请求以及应答(Router Writen by C++ including ARP)
    2020-06-25 10:20:01下载
    积分:1
  • RemoteStartup
    说明:  远程开机的程序,有mfc,vc++,非常实用(Remote boot-consuming procedures, mfc, vc++, Very useful)
    2008-11-21 11:04:54下载
    积分:1
  • C06策略
    c06tb套利交易策略源码,源码为人人宽客编写分享(C06tb arbitrage strategy source code, source code for everyone to share quants written)
    2017-09-22 09:54:00下载
    积分:1
  • 多功能聊天
    利用VC++6.0来实现一个类似QQ的聊天程序。本程序只实现添加好友,文字聊天,文件传输和语音聊天4大功能。(VC 6.0 to achieve a similar QQ chat program. This procedure will only add to achieve good friend, text chat, file transfer, and voice chat four major functions.)
    2020-06-26 08:00:02下载
    积分:1
  • TCPIPxieyijiwangluobiancheng
    TCP/IP协议及网络编程技术,是网络编程学习或者爱好者的从入门到精通的一本必备电子书籍!!!!(TCP/IP protocol and network programming, network programming enthusiasts or learning entry to master an essential e-books! ! ! !)
    2016-03-28 14:03:27下载
    积分:1
  • 696518资源总数
  • 104349会员总数
  • 32今日下载