通过 Java Web 服务调用在 .NET CF 客户端中显示进度条

发布于 2024-12-27 14:48:25 字数 318 浏览 2 评论 0原文

我有一个使用紧凑框架 2 制作的 Web 服务客户端,它调用 java Web 服务。 Web 服务返回大小仅为 200 KB 的字节数组,但在某些 GPRS 连接中会延迟几分钟。我想用进度条显示下载数据的进度,但我还没有找到任何示例。有人知道怎么做吗? 我找到了这个网址,但我认为它不适合 CF 客户端。

http://msdn.microsoft.com/en-us/library/aa480520.aspx谢谢

I have a web service client made with compact framework 2 that call a java web service.
Web service return a byte array that sizes only 200 KB, but in some GPRS connections it delays some minutes. I want to show the progress of the downloaded data with a progress bar, but I haven't found any example. Does anybody knows how do it?
I have found this url, but I think that it isn't for CF clients.

http://msdn.microsoft.com/en-us/library/aa480520.aspx

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

溺孤伤于心 2025-01-03 14:48:25

我相信您将不得不自己跟踪进度条。

如果您的 java web 服务调用向您发送了总文件大小,您可以将 ProgressBar Maximum 设置为此,否则,您无法知道刚刚收到的数据块总数的百分比是多少。

清楚了吗?

更新:

在您发布的链接中,每个块中接收的数据量在行中定义*:

int bytesRead 
  = m_oldStream.Read(m_bufferIn, 
  0, 
  m_readSize);

这将是您增加 ProgressBar Value 的量

免责声明:我没有花太多时间查看您提供的链接中的代码,我对它的快速分析可能是错误的。

I believe you are going to have to keep track of your progress bar on your own.

If your java web service call sends you the total file size, you can set your ProgressBar Maximum to that, otherwise, you have no way of knowing what percentage of the total the data chunk you just received is.

Is that clear?

Update:

In the link you posted, the amount of data received in each chunk is define on the line*:

int bytesRead 
  = m_oldStream.Read(m_bufferIn, 
  0, 
  m_readSize);

This would be the amount you increment your ProgressBar Value.

Disclaimer: I have not spent much time reviewing the code in the link you provided, and my quick analysis of it could be wrong.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文