文档库 最新最全的文档下载
当前位置:文档库 › Windows Phone 7 文件下载进度和速度显示

Windows Phone 7 文件下载进度和速度显示

Windows Phone 7 文件下载进度和速度显示
Windows Phone 7 文件下载进度和速度显示

Windows Phone 7 文件下载进度和速度显示

用http协议来下载网络上的文件,通常我们需要获取文件文件的下载进度和下载的速度来给用户等待过程的一个交代,那么在windows phone 7下可以使用WebClient类来实现这一功能,HttpWebRequest类也可以用于下载网络上的文件,不过HttpWebRequest类不能够直接地获取你http请求的完成情况。

使用WebClient.DownloadProgressChanged事件来异步获取http协议下载文件的进度情况,使用WebClient.DownloadStringCompleted事件来判断文件的下载是否完成。

x:Class="DownLoadTest.MainPage"

xmlns="https://www.wendangku.net/doc/2816201202.html,/winfx/2006/xaml/presentation"

xmlns:x="https://www.wendangku.net/doc/2816201202.html,/winfx/2006/xaml"

xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"

xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"

xmlns:d="https://www.wendangku.net/doc/2816201202.html,/expression/blend/2008"

xmlns:mc="https://www.wendangku.net/doc/2816201202.html,/markup-compatibility/2006"

mc:Ignorable="d"d:DesignWidth="480"d:DesignHeight="768"

FontFamily="{StaticResource PhoneFontFamilyNormal}"

FontSize="{StaticResource PhoneFontSizeNormal}"

Foreground="{StaticResource PhoneForegroundBrush}"

SupportedOrientations="Portrait"Orientation="Portrait"

shell:SystemTray.IsV isible="True">

相关文档
相关文档 最新文档