how to set timer for different urls RRS feed

  • Question

  • Hi,
    I am working on a windows mobile application(c#) which does the work of reading RSS feeds.I have a form wherein I allow the user to enter a url and also a checkbox is there which says if the feeds need to be updated after every 5 minutes.

    1) I have implemented the same by using a timer for single subscribed url.(once subscribed the feeds are displayed in a treeview and after 5 mins thy are downloaded again).Can anyone provide me a sample code as to how can i set the timer for more than 1 subscibed url.Do we have to set different timer instances for each subscribed urls?

    code used for single subscribed url is:
    if (checkBox1.Checked)
                                    timerdownload = new Timer();
                                    timerdownload.Enabled = true;
                                    timerdownload.Interval = 300000;
                                    timerdownload.Tick += new EventHandler(timerdownload_Tick);
    Its an urgent requirement.Please provide pointers.
    Thanks in advance

    Wednesday, August 19, 2009 9:20 AM


All replies

  • Hi,

    If you want to run URLs on different time intervals, you must need to start different timers or you can make use of multi threading. As it is urgent requirement, better carry on with different timers.

    If you want to run the multiple URLs on same time interval, you can run with single timer.

    Wednesday, August 19, 2009 9:28 AM
  • Hi Malleswar,

    Thanks for your response. Can you provide me a sample code as to how can i set different timers for different urls subscribed at different time(but the time interval is fixed ..5 mins .i.e after every 5 mins the download of the specific url shuld take place.Suppose if i have subcribed my first url at 10.30 then it should be refreshed after every 5 mins...so next time it will  download feeds at 10.35.Similarly if i have subscribed to second url at 10.32 it should get refreshed at 10.37...time interval is fixed(5 mins))

    As you said...If you want to run the multiple URLs on same time interval, you can run with single timer...how to do this?? sample code please.
    Please help.
    Thursday, August 20, 2009 3:16 AM
  • Hi,

    The project (Update Multiple Urls Tester) at the following location may point you in the right direction :-


    Hope this helps.

    Paul Diston
    • Proposed as answer by Amit Rote Thursday, August 20, 2009 8:59 AM
    • Marked as answer by ZHE ZHAO Tuesday, August 25, 2009 1:16 AM
    Thursday, August 20, 2009 7:28 AM