简单的web抓取类:string Get(string URL),bool Busy和Stop()成员 [英] Simple web fetching class with: string Get(string URL), bool Busy and Stop() members

查看:72
本文介绍了简单的web抓取类:string Get(string URL),bool Busy和Stop()成员的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找简单的课程来获得一些成员的网页

控制执行:

1.字符串获取(字符串URL) - 只是得到html-page

2. bool忙 - 在对象加载资源时返回true

3.停止()停止执行


使用HTTPWebRequest.GetResponse有问题,因为它锁定主要的

线程。


任何想法?


问候,

Anton

I''m looking for simple class to get web-page with some members to
control execution:
1. string Get(string URL) - just get html-page
2. bool Busy - return true while object loading resource
3. Stop() to stop execution

There are problems to use HTTPWebRequest.GetResponse as it lock main
thread.

any ideas?

Regards,
Anton

推荐答案

3月19日上午8:35,x.meg ... @ gmail.com写道:
On Mar 19, 8:35 am, x.meg...@gmail.com wrote:

我正在寻找简单的类来获得一些成员的网页

控制执行:

1.字符串获取(字符串URL) - 只需获取html页面

2. bool忙 - 在对象加载资源时返回true

3 。停止()停止执行


使用HTTPWebRequest.GetResponse有问题,因为它锁定了主要的

线程。


任何我DEAS?
I''m looking for simple class to get web-page with some members to
control execution:
1. string Get(string URL) - just get html-page
2. bool Busy - return true while object loading resource
3. Stop() to stop execution

There are problems to use HTTPWebRequest.GetResponse as it lock main
thread.

any ideas?



嗯,最明显的是不要在UI线程上调用GetResponse。

要么使用不同的线程,要么使用BeginGetResponse代替

传递回调。


Jon

Well, the most obvious is not to call GetResponse on the UI thread.
Either use a different thread, or use BeginGetResponse instead and
pass in a callback.

Jon


你可以帮我实现这个课程?我没有使用

线程的经验...

You can help me to realize this class? I have not experience with
threads...


我只需要一个机会来停止进程并学习它的忙碌

州。

I require only an opportunity to stop process and to learn its busy
state.


这篇关于简单的web抓取类:string Get(string URL),bool Busy和Stop()成员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆