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

  • XproerV3.0.107_51aspx
    XproerBBS开源项目是新手学习不可多得的资料,在项目中使用了许多目前比较流行的技术。 (1)如何使用ADO.NET, (Green hand XproerBBS open-source projects are hard to come by studying the information used in the project is currently much more popular technology. (1) how to use ADO.NET,)
    2009-03-26 09:56:24下载
    积分:1
  • Source
    说明:  Source wyd 7.55, contem alguns bugs em c++ , Source wyd 7.55, contem alguns bugs em c++
    2020-06-19 01:00:02下载
    积分:1
  • msocudp
    微软提供的UDP编程实例代码,实现了客户端向服务端发送数据的功能,服务器端接收并显示。(UDP programming example code provided by Microsoft client functionality to send data to the server, the server-side receiver and display.)
    2012-09-05 22:12:35下载
    积分:1
  • C#版QQ登录助手+源代码(含在线序升级源码)
    C#版QQ登录助手+源代码(含在线程序升级源码)
    2014-06-22下载
    积分:1
  • TCPaUDP
    一段TCP和UDP通讯的程序,包含了服务器端和客户端的代码。(Some TCP and UDP communication procedures, including server and client code.)
    2014-07-21 08:28:29下载
    积分:1
  • BOIL
    fluent的UDF程序,用于水变为冰的凝固计算(fluent in the UDF program for calculating the freezing water into ice)
    2021-04-16 19:58:53下载
    积分:1
  • client-server
    多协议文件传输c/s网络应用设计与实现,程序用 TCP/UDP 两个协议模拟多协议服务器。首先服务器端要将两种协议的套接字创建好,并且监听 TCP 端口的连接。必要时使用select函数来进行多连接处理和非阻塞处理。而客户端直接可以按照发送的地址和端口号来进行通讯。 首先要运行服务器端,服务器会监听 TCP 端口。然后运行客户端,根据事先设定好的 IP和端口,就可以进行连接传输数据了。 程序实现的关键步骤: 以TCP协议为例 服务器端: 1.创建套接字;2.绑定端口;3.进入无穷的循环;4.接收请求;5.处理请求;6.应答。 客户端: 1.找到服务器的IP地址和协议的端口号;2.创建套接字;3.确定连接需要任意的,没有使用的端口号允许TCP去选择一个;4.将套接字和服务器连接;5.使用应用层协议和服务器交互;6.关闭连接。 (Multi-protocol file transfer c/s network application design and implementation of programs simulate multi-protocol server with TCP/UDP both protocols. First socket server to create a good two protocols, TCP port and listens for connections. If necessary, use the function to handle multiple connections and non-blocking treatment. And the client can follow directly address and port number to communicate. First run on the server side, the server listens on TCP port. Then run the client, according to pre-configured IP and port, you can connect the data transmission. The key step program implementation: In TCP protocol as an example Service-Terminal: 1. Create a socket 2 bound port 3 enter an infinite loop 4. receiving a request 5. processing requests 6 response. Clients: 1. Locate the server s IP address and protocol port number 2 creates a socket 3 connections need to determine arbitrary, unused port allows TCP to choose a 4 and the socket server connections 5 using appli)
    2016-07-11 10:19:07下载
    积分:1
  • C和指针
    说明:  学习c语言必读的一本书,指针讲解的很透彻。(c program language pointer)
    2020-06-24 06:20:02下载
    积分:1
  • SPEI
    SPEI计算SPEI的R语言版与可执行版(含下载网址).rar(SPEI calculated SPEI R-language version of the executable version (with download link). Rar)
    2020-10-17 14:37:27下载
    积分:1
  • WSAAsyncSelect
    说明:  基于 异步选择模型的聊天程序,简单实现服务器和客户端的对话(Select model based on asynchronous chat program, simple implementation of server and client dialogue)
    2010-04-24 19:35:55下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载