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:
|
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 NPosted Dec 15, 2010, 9:10 PM
sebastianPosted Dec 15, 2010, 1:38 PM
by the way: I've got it now! thanks again!
Suthish NairPosted Dec 15, 2010, 12:13 PM
Why you posting such replies. Its in php, this is an C# Corner forum.
Santhosh NPosted Dec 15, 2010, 9:11 AM
sebastianPosted Dec 15, 2010, 8:26 AM
@ 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 ...
CrishPosted Dec 15, 2010, 4:11 AM
You can refer below code to solve the issue of update data without refreshing whole browser.
Santhosh NPosted Dec 15, 2010, 1:37 AM
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);