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

  • SEVER
    多人在线的网络聊天室—服务器,简化实用 可以修改后添加其他功能(Multiplayer online chat rooms- server, simplifying practical Other functions can be modified to add)
    2013-10-05 19:42:35下载
    积分:1
  • JustChat
    基于CS模式的聊天软件,具有加密功能,服务器端得数据库操作自己实现。(base on CS model chat tool)
    2011-07-28 11:22:52下载
    积分:1
  • SuperSocket.ClientEngine-master(1)
    说明:  SuperSocket ClientEngine
    2018-12-27 14:46:01下载
    积分:1
  • C#通过webservice获取天气预报 例子源码下载
    webservice网址是 
    2015-05-06下载
    积分:1
  • 组播工具
    说明:  组播测试工具,可以接收和发送组播。可同时支持加入32个组播(multicast tools for ip.)
    2020-06-17 21:40:02下载
    积分:1
  • sxesuvy
    用VC开发的C语言编写的MD5程序源码,作为开发md5的参考(The source code of MD5 program written in C language developed by VC is a reference for developing md5.)
    2018-12-31 16:12:09下载
    积分:1
  • Desktop
    onvif协议ptz服务端和客户端程序,可以实现服务端服务和客户端访问(onvif ptz server client program)
    2012-03-06 12:35:30下载
    积分:1
  • Fins_manual
    c++ 基于FINS协议与OMRON PLC进行tcp udp 通信(c++ base on fins protocol to communicate with omron plc by tcp udp)
    2015-08-18 16:00:09下载
    积分:1
  • progrgms
    说明:  aswindows programs code i am is a
    2018-12-25 12:14:01下载
    积分:1
  • usesjabyrinth
    The turtle walks the labyrinth experiment, uses the MFC in VC to draw the labyrinth, and lets the turtle find a way out of the maze
    2018-12-24 04:39:14下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载