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

  • SipRecordServer
    在vc++下通过ip端口抓取数据包,获取音频数据进行处理(In vc++ crawl through the ip port packet)
    2013-11-07 16:26:26下载
    积分:1
  • Jlink_ob自制:STM32F103C8T6核心板测试序(PB12闪烁)
    Jlink_ob自制:STM32F103C8T6核心板测试程序(PB12闪烁)
    2020-06-22下载
    积分:1
  • icmp_jiance
    利用ICMP实现网络状态监测系统,描述了系统架构,实现方法、优缺点等。(Use ICMP network status monitoring system, describes the system architecture, implementation methods, advantages and disadvantages.)
    2014-06-29 22:14:28下载
    积分:1
  • msluyple-pair
    利用http协议实现网络通信,是基于c语言编写(Use the HTTP protocol to realize network communication, is based on the c language)
    2017-03-25 00:57:12下载
    积分:1
  • dotNetGuestBook
    asp.net简单留言板 asp.net简单留言板 asp.net简单留言板(asp.net simple message board)
    2020-07-02 12:40:02下载
    积分:1
  • WinPing
    MFC界面的PING程序 输入主机地址或者IP地址 发送五次ICMP请求(PING procedure MFC interface type the host address or IP address to send five ICMP request)
    2008-04-26 22:05:18下载
    积分:1
  • domain-ip
    说明:  根据域名获得IP地址列表 根据域名获得IP地址列表(under the name list of IP addresses under the domain of IP address list)
    2006-03-29 15:53:55下载
    积分:1
  • winsocket-transpot
    MFC类下的winsock多线程实现文件传输,在vc++6.0下通过调试。(MFC category under the winsock multithreading document transmission, the 6.0 vc through debugging.)
    2007-03-21 16:45:22下载
    积分:1
  • Qt_BarCode-master
    说明:  使用zint,生成二维码,条形码多种编码格式(Generate two-dimensional code, bar code)
    2021-01-30 13:28:33下载
    积分: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
  • 696516资源总数
  • 106658会员总数
  • 16今日下载