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 10 1926
On Mar 19, 8:35 am, x.meg...@gmail.com wrote:
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?
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.
On Mar 19, 8:53 am, "Meglio" <x.meg...@gmail.comwrote:
You can help me to realize this class? I have not experience with
threads...
See http://pobox.com/~skeet/csharp/threads to learn about threading.
Jon
On Mar 19, 8:55 am, "Meglio" <x.meg...@gmail.comwrote:
I require only an opportunity to stop process and to learn its busy
state.
Well, there's no way of "stopping" a web request when it's been sent,
although you don't need to fetch the whole response, of course. As for
"busy" - I guess that's any time before you've received the whole
response.
Jon
I need just to stop data transferring process when Stop() is called
immediately. Is it possible with treads?
I'm also Delphi developer, so, for example, in Delphi I create hidden
TWebBrowser component,
then call Navigate(URL), and can use Busy: boolean property as well as
Stop method.
The WebRequest (which HttpWebRequest derives from) has an Abort method
which can be used to abort a request.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Jon Skeet [C# MVP]" <sk***@pobox.comwrote in message
news:11**********************@n59g2000hsh.googlegr oups.com...
On Mar 19, 8:55 am, "Meglio" <x.meg...@gmail.comwrote:
>I require only an opportunity to stop process and to learn its busy state.
Well, there's no way of "stopping" a web request when it's been sent,
although you don't need to fetch the whole response, of course. As for
"busy" - I guess that's any time before you've received the whole
response.
Jon
but when HTTPWebRequest is called, thread is blocked,
and we can wait for GetResponse method.
So, we can't call Abort() method
On Mar 21, 11:52 am, "Meglio" <x.meg...@gmail.comwrote:
but when HTTPWebRequest is called, thread is blocked,
and we can wait for GetResponse method.
So, we can't call Abort() method
So don't use GetResponse - use BeginGetResponse, as I suggested
before.
Jon This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: disgracelands |
last post by:
I'm starting to develop an application in Python running the interpreter
from C, i've got callbacks and stuff setup (was pretty pleased with that)
and i'm starting to get my head around the...
|
by: DanielBradley |
last post by:
Hello all,
I have recently been porting code from Linux to cygwin and came across
a problem with static const class members (discussed below). I am
seeking to determine whether I am programming...
|
by: Steven T. Hatton |
last post by:
Sorry about the big code dump. I tried to get it down to the minimum
required to demonstrate the problem. Although this is all done with GNU, I
believe the problem I'm having may be more general. ...
|
by: C-Sharper or C-Hasher, one of the two |
last post by:
Hi,
I have a C# class libary (Class1) which is inherited by another class in a
Windows Forms app. I want this other class to implement some, but not all of
the features of the base class. How...
|
by: Robert Ludig |
last post by:
How do I bind a textbox to a simple string varaible with databinding?
I managed to do the binding but unfortnatedly the textvox does not get
updated when I change the string wich the textbox is...
|
by: Bonj |
last post by:
I'm having problems using static members of a class (largely HANDLEs of various sorts) as static class members of a class. It compiles OK but the linker complains of unresolved external symbol....
|
by: lovecreatesbea... |
last post by:
I) List of synthesized class members
By default, a class gets
1. default construction
2. copy construction
3. assignment
4. . (dot)
5. , (comma)
6. destruction
|
by: Dennis Jones |
last post by:
Hello,
I have a class that will eventually look something like this:
class TTableHolder
{
private:
boost::scoped_ptr<TSessionFSession;
boost::shared_ptr<TTableFTable;
|
by: Joel |
last post by:
Is it true that if we don't specify a default constructor for
our class, then the C# compiler provides us with its own
that zeroes (or assigns default values) to the data members?
I wrote a...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| | |