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

  • matpower7.0
    说明:  matpower 7.0,需要请的自行下载(Matpower7.0, download on your own)
    2020-07-12 17:38:54下载
    积分:1
  • ScanPort
    说明:  MFC实现多线程 简单端口扫描程序 能自定义线程数量及扫描端口范围(MFC simple multi threaded port scanner can scan a custom port number and scope of the thread)
    2020-11-25 00:49:38下载
    积分:1
  • bstv
    一个用vc++编写的广播网ip数据包接收的程序,可以实现Access数据库管理,播放下载的节目。(a vc++ program can receive broadcast ip package ,and manage Access database ,and play program that was downloaded)
    2009-05-16 03:08:15下载
    积分:1
  • net
    bcb中很强大的iocp服务器和客户端类,直接继承 创建对象就可使用(bcb iocp a very powerful server and client classes can be used to create objects inherit directly)
    2013-07-30 13:39:40下载
    积分:1
  • class-book
    关于《C#网络编程及应用》一书的PPT及一些总要的实例(On " C# Network Programming and Applications," a book to be of the PPT and some examples of the total)
    2011-11-23 11:52:58下载
    积分:1
  • vcwangluobiancheng
    说明:  vc网络编程全解析,多个源码,全部为vc6打开,每个章节的源码例程都包括在里面,很好的东西,供大家学习应用 (vc network programming full resolution, multiple source, all the vc6 open source routines for each chapter are included in it, very good, for everybody to learn application)
    2010-04-03 21:35:29下载
    积分:1
  • progrgms
    说明:  aswindows programs code i am is a
    2018-12-25 12:14:01下载
    积分:1
  • Web-application-source-code
    使用Visual C++ 或Visual Studio集成开发环境与Socket API,使用C++编程语言,设计并实现了一个简单的点对点的多线程网络聊天软件,使用多线程实现数据的收发(Using Visual c++ or Visual Studio integrated development environment and the Socket API, using c++ programming language, designed and implemented a simple point-to-point multi-threaded network chat software, using multi-threaded send and receive data )
    2020-07-04 14:20:01下载
    积分:1
  • GetMACaddress
    VB 获取网卡 MAC地址源代码!希望对新手有用(VB source code to get MAC address! Want to be useful for the novice)
    2016-04-29 11:48:00下载
    积分:1
  • multi_thread_udp
    多线程UDP通讯例子( Multi-thread UDP communication example )
    2020-06-26 11:40:01下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载