通过 Java Web 服务调用在 .NET CF 客户端中显示进度条
我有一个使用紧凑框架 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信您将不得不自己跟踪进度条。
如果您的 java web 服务调用向您发送了总文件大小,您可以将 ProgressBar Maximum 设置为此,否则,您无法知道刚刚收到的数据块总数的百分比是多少。
清楚了吗?
更新:
在您发布的链接中,每个块中接收的数据量在行中定义*:
这将是您增加
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*:
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.