gpt4 book ai didi

windows-phone-7 - Windows Phone 7 - 如何下载有进度的文件?

转载 作者:行者123 更新时间:2023-12-01 08:35:04 25 4
gpt4 key购买 nike

如何在 Windows Phone 7 中下载带有进度条的大文件?

最佳答案

虽然克劳斯的回答可行,但可能更简单的解决方案是使用网络客户端。它看起来像这样:

    ...
WebClient wb = new WebClient();
wb.DownloadProgressChanged += wbchange;
...

private void wbchange(object sender, DownloadProgressChangedEventArgs e)
{
progressBar2.Value = e.BytesReceived;
progressBar2.Maximum = e.TotalBytesToReceive;

int val = (int)(e.BytesReceived / 1048576);
int max = (int)(e.TotalBytesToReceive / 1048576);

textBlock4.Text = val + "MB out of " + max.ToString() + "MB";
}

此代码将显示一个带有进度的进度条和一个带有 MB 进度的文本 block 。

关于windows-phone-7 - Windows Phone 7 - 如何下载有进度的文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12334373/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com