zoukankan      html  css  js  c++  java
  • Silverlight 3 中使用WCF上传文件 (简单进度条展示)

     一般来说,文件上传总是需要的,可以通过ashx及其wcf或其它方式实现,这里主要是wcf实现方式,并附之简单的进度显示。。。

    1.  silverlight 项目一般有silverlight和silverlight.web(asp.net)两个基本项目,在这里我们需要在silverlight.web(asp.net)项目中添加一个Silverlight enabled wcf service文件,其功能主要是实现文件上传。

    WCF文件所在项目: 

    WCF文件类型:

    相应代码如下:

    Code

     

    2.  在Silverlight中添加服务引用就OK,然后在相应的界面实现即可,简单实现如下:

    在MainPage.xaml加入了如下一个Button

    <Button Grid.Row="1" Grid.Column="3" x:Name="btnWCFUpload" Content="WCFUpload" Height="20" Width="80" />

    在MainPage.xaml.cs中加入如下

    Code

    3.  效果如下

    当然,如果用wcf实现方式,可能会给发布带来一定麻烦。。。

    因为在ClientBin中的BlackCore.xap(这里我的项目的压缩包)中的ServiceReferences.ClientConfig中有生成的配置信息,如果要部署是需要更改的

    Servicereferences.ClientConfig文件配置信息如下:

    Code

    所以,使用WCF还应该想个办法解决发布部署问题,也就算WCF文件上传是成功的。

    此问题本人暂时没有解决,如遇能人,恳请赐教,谢谢!

  • 相关阅读:
    14.4.9 Configuring Spin Lock Polling 配置Spin lock 轮询:
    14.4.8 Configuring the InnoDB Master Thread IO Rate 配置InnoDB Master Thread I/O Rate
    14.4.7 Configuring the Number of Background InnoDB IO Threads 配置 后台InnoDB IO Threads的数量
    14.4.7 Configuring the Number of Background InnoDB IO Threads 配置 后台InnoDB IO Threads的数量
    14.4.6 Configuring Thread Concurrency for InnoDB 配置Thread 并发
    14.4.6 Configuring Thread Concurrency for InnoDB 配置Thread 并发
    14.4.5 Configuring InnoDB Change Buffering 配置InnoDB Change Buffering
    14.4.5 Configuring InnoDB Change Buffering 配置InnoDB Change Buffering
    14.4.4 Configuring the Memory Allocator for InnoDB InnoDB 配置内存分配器
    14.4.4 Configuring the Memory Allocator for InnoDB InnoDB 配置内存分配器
  • 原文地址:https://www.cnblogs.com/blackcore/p/1607823.html
Copyright © 2011-2022 走看看