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

  • RipEmurator
    说明:  Rip协议实现 仿真器, 技术上包括Qt TableView,UDPSocket。(Emulator Rip protocol implementation, technically, including Qt TableView, UDPSocket.)
    2021-04-20 21:18:50下载
    积分:1
  • socket
    利用EPOLL写的一个简单的connect非阻塞模型(Written by EPOLL connect a simple non-blocking model)
    2011-06-02 09:06:26下载
    积分:1
  • PsSuspendThread
    内核中暂停任意线程代码,qq Protect相关(Kernel suspend any thread)
    2013-07-29 14:46:02下载
    积分:1
  • BroadCast_guanbo
    广播... 可以供初学网络编程的人参考... 完整 并且在winXP Visual C++6.0调试通过(... can Broadcasting Network Programming for the novice to the integrity of reference ... in winXP Visua l C by 6.0 Debugging)
    2007-04-20 19:42:31下载
    积分:1
  • 1
    说明:  WinSock网络编程实用宝典。适合初学者以及深入理解网络编程的朋友。(WinSock network programming practical Collection. Suitable for beginners as well as in-depth understanding of network programming friends.)
    2011-07-04 17:38:27下载
    积分:1
  • FEC_Code_Project
    很好的能解决网络数据丢包处理的算法。特别是在带宽一定的情况下,解决网络数据传输和带宽、数据传输完整性的较优解决方案。(good solution processing network data packet loss algorithms. Especially in certain circumstances bandwidth, the solution to network bandwidth and data transmission, data transmission integrity of the optimum solution.)
    2007-05-18 10:12:02下载
    积分:1
  • RawSocket
    说明:  网络安全编程,VC++环境,原始套接字,源代码文件,某些系统可能不支持原始套接字,这只是一个原理性的说明(Network security programming, VC++ environment, raw sockets, source code files, some systems may not support raw sockets, this is only a schematic description of)
    2010-03-27 20:40:30下载
    积分:1
  • SendMail199985242001
    用vc实现邮件传输功能,主要采用winsock实现传输过程。有利于熟悉网络编程。(achieved using vc mail functionality, mainly winsock achieve transfer process. Help familiar with network programming.)
    2005-07-27 19:47:56下载
    积分:1
  • FPGA
    说明:  实现人脸识别,通过硬件FPGA来进行实现(Realize face recognition, realize face recognition by hardware FPGA)
    2020-12-23 10:19:07下载
    积分:1
  • tes
    对于网络开发包的详细解释,包括了libcap和libnid等(For a detailed explanation of the network development kit, including the libcap and libnid of)
    2012-10-23 10:24:33下载
    积分:1
  • 696516资源总数
  • 106459会员总数
  • 0今日下载