Silverlight文件上传下载实现方法(下载保存)

2019-12-30 11:12:34于丽

易采站长站为您分析Silverlight文件上传下载实现方法(下载保存) ,需要的朋友可以参考下

search了非常多的文章,总算勉强实现了。有许多不完善的地方。

在HCLoad.Web项目下新建目录Pics复制一张图片到根目录下。

图片名:Bubble.jpg 右击->属性->生成操作:Resource

UC_UpDown.xaml

 

 
  1. <UserControl x:Class="HCLoad.UC_UpDown"  xmlns="http://www.easck.com/winfx/2006/xaml/presentation" 
  2. xmlns:x="http://www.easck.com/winfx/2006/xaml"  Width="500" Height="500"> 
  3. <StackPanel Background="White" Height="450">  <Button Content="down" Click="Button_Click"></Button> 
  4. <HyperlinkButton Content="下载保存" NavigateUri="http://www.easck.com/>  <TextBlock x:Name="tbMsgString" Text="下载进度" TextAlignment="Center" Foreground="Green"></TextBlock> 
  5. <Button x:Name="btnDownload" Content="DownLoad Pictures" Width="150" Height="35" Margin="15" Click="btnDownload_Click"/>  <Border Background="Wheat" BorderThickness="5" Width="400" Height="280"> 
  6. <Image x:Name="imgDownLoad" Width="400" Height="300" Margin="15" Stretch="Fill"/>  </Border> 
  7. <Button x:Name="btnUpLoad" Content="UpLoad Pictures" Width="150" Height="35" Margin="15" Click="btnUpLoad_Click"/>  </StackPanel> 
  8. </UserControl>