I'm pretty new to C#, but I decided to start a little project to understand the way of C#!
So, I want to get some data from the html file of a webpage. I'm currently doing that with the following method:
C# |
after running the method, I'm actually getting those ressources!
But on the real webpage, the ressources are refreshing every second. In my program they aren't!
Can I somehow repeat the method every second? I've tried to put the code lines 5-7 in an endless while-loop, but that causes my program to "not response", logically ^^.
If you told me any method to check for a change and update those ressources if there were, without letting the program cash, i'd be very thankfull! I'm having this problem with some other methods, too.
thanks! Basti

Santhosh NRank #4,788 · 325 reputationPosted Dec 14, 2010, 8:37 PM EST
timer1_tick
{
string[] ressources = new string[3];
ressources[0] = browser.Document.GetElementById("res1").InnerHtml.;
ressources[1] = browser.Document.GetElementById("res2").InnerHtml;
ressources[2] = browser.Document.GetElementById("res3").InnerHtml;
return ressources;
}
If its web app, you could use setTimeOut function to call the function recursively after configured milliseconds
setTimeOut(functionName, 100);
CrishRank #1,487 · 1.1K reputationPosted Dec 14, 2010, 11:11 PM EST
You can refer below code to solve the issue of update data without refreshing whole browser.
php if ($_SERVER['REQUEST_METHOD'] == 'POST') { // insert the data here header('Location: /createdClass.php'); exit(); } ?> php echo $_SERVER['PHP_SELF']; ?>" method="post"> ... I think it will help you.sebastian5 reputationPosted Dec 15, 2010, 3:26 AM EST
@ santhosh: Can i use the timer just like you did? without implementing or "using" anything? I'll also check this out when i'm at home!
@ crish: Sorry, but I don't understand your code :|
In general: what does it do? I only understood that it does only work if the send-method is "post" - if the server uses this method ...
Santhosh NRank #4,788 · 325 reputationPosted Dec 15, 2010, 4:11 AM EST
Suthish NairRank #92 · 22.8K reputationPosted Dec 15, 2010, 7:13 AM EST
Why you posting such replies. Its in php, this is an C# Corner forum.
sebastian5 reputationPosted Dec 15, 2010, 8:38 AM EST
by the way: I've got it now! thanks again!
Santhosh NRank #4,788 · 325 reputationPosted Dec 15, 2010, 4:10 PM EST