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

  • getpclist
    Visual C#得到局域网计算机列表,也就是获取局域网内的所有在线的主机名称列表,请确保您的电脑在网络中,要不然程序获取时候可能要假死,需要强制结束任务。(Visual C# to get a LAN computer list, which is to obtain a list of all the online host names within the LAN, make sure your computer is on the network, or else the program when you may want to get suspended animation, you need to force the end of the task.)
    2014-09-12 08:56:36下载
    积分:1
  • C# adsl 断拨号例子源码(xp测试通过了)
    adsl断开/拨号例子 含完整源码下载,有截图
    2013-09-04下载
    积分:1
  • WindowsSockets
    SOCKET编程规范(SOCKET programming specification)
    2008-03-27 15:35:30下载
    积分:1
  • syn
    SYN Flood是当前最盛行的DoS(拒尽服务进攻)与DDoS(散布式拒尽服务进攻)的方法之一,这是一种利用TCP协议缺点,发送大批伪造的TCP连接请求,从而使得被进攻方资源耗尽(CPU满负荷或内存不足)的进攻方法。(SYN Flood is one of the most popular DoS (refuse to do service attack) and DDoS (Distributed refuse to do service attack), which is a Use the TCP protocol shortcomings, sending a large number of forged TCP connection requests, making the offensive resource exhaustion (CPU full load or memory) Offensive....)
    2012-02-24 21:09:08下载
    积分:1
  • 99273901LSP
    说明:  lsp vc++6 dsw基本能用,网上下载的(lsp vc++6 dsw download form www)
    2020-06-21 05:40:01下载
    积分:1
  • DMMidddleWare
    部署在服务器公网上 实现内外网通讯的源码,外部程序连接到这个程序,这个程序再连接内部服务器(Deployed on the server the public Internet to achieve internal and external network communication)
    2012-02-10 15:46:10下载
    积分:1
  • socket 通信,tcp卡機通信,堆棧先進先出
    socket 通信,tcp卡機通信,堆棧先進先出
    2015-04-20下载
    积分:1
  • Scan
    局域网共享扫描MFC多线程编写 具有端口扫描 共享扫描 IP扫描 mac扫描等功能(MFC multi-threaded scanning local area network to share the preparation of a port scan scanner share scanner functions such as IP scanning mac)
    2009-10-21 20:15:30下载
    积分:1
  • Web服务器和浏览器的设计
    说明:  网络编程中C++ Web服务器和浏览器的设计源代码,用于网络编程实验。(The design source code of C++ Web server and browser in network programming is used for network programming experiment.)
    2019-01-08 21:12:52下载
    积分:1
  • TCPIPclient
    基于MFC的TCP/IP socket编程,一个客户端程序,适合初学者学习,开发平台vs2015(TCP/IP SOCKRT programing based on MFC,A client program ,very good for first learner the develop platform is vs2015)
    2016-09-23 13:01:14下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载