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

  • network
    网络分析,选取点,对所选取的点进行网络分析和计算(Network analysis, select points, network analysis and calculation of the selected points)
    2017-06-27 15:06:09下载
    积分:1
  • webspider
    说明:  可以从网络上下载网页,采用多线程编程技术,下载速度更快,并可以记录下载网页数量(network can be downloaded from the website, using multithreaded programming techniques, faster download speeds and can be downloaded from the website record number)
    2005-09-11 09:10:50下载
    积分:1
  • vnc-4.0-winsrc_dll
    vnc 封装成dll的代码,方便各位使用修改(vnc package into the dll code, convenient for you to use modified)
    2012-06-18 10:49:59下载
    积分:1
  • C#通过webservice获取天气预报 例子源码下载
    webservice网址是 
    2015-05-06下载
    积分:1
  • STR
    structures for rf online 2/2/3 server
    2010-06-05 13:52:20下载
    积分:1
  • Chat
    程序利用多线程技术和socket技术实现网上聊天程序。服务器程序和客户端程序在同一程序里。(This program realizes the chatting fuction using the multithread technique and socket programming.)
    2016-07-24 11:49:37下载
    积分:1
  • Winsock
    关于网络编程客户端之间相互监听的网络编程程序代码(Programming on the network between the client network programming code monitor)
    2010-12-19 23:20:09下载
    积分:1
  • iprout-hash
    一种基于hash表的IP路由表搜索技术,在WINDOWS下VC++实现(a hash table based on the IP routing table search technology, under the VC WINDOWS)
    2007-01-04 14:13:20下载
    积分:1
  • TCP
    说明:  TCP服务器和客户端C++类,提供简单的TCP通讯功能(TCP server and client c + + class, provide simple TCP communication function)
    2021-03-06 21:37:18下载
    积分:1
  • HCR Protocol in Matlab by www.wsnlab.org
    HRP Routing Protocol using NS2
    2018-02-06 14:31:13下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载