How to poll to get continous data ?
-
I am writing a program in .Net where the code gets a XML document from a URL( like the code below)and reads the XML document.But I dont know how to make the program keep on polling so that I can get the XML document continuosly or at some intervals . Any links or suggestions? Code:- Dim reader As XmlTextReader = New XmlTextReader("http://192.168.10.12/cgi-bin/dataProxy?oper=queryTags&map=1") While reader.Read() { .... }
-
I am writing a program in .Net where the code gets a XML document from a URL( like the code below)and reads the XML document.But I dont know how to make the program keep on polling so that I can get the XML document continuosly or at some intervals . Any links or suggestions? Code:- Dim reader As XmlTextReader = New XmlTextReader("http://192.168.10.12/cgi-bin/dataProxy?oper=queryTags&map=1") While reader.Read() { .... }
You'll have to use a Timer control to poll for the data. You'll find one in the ToolBox. You can Google for "System.Windows.Forms.Timer" for more information.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
I am writing a program in .Net where the code gets a XML document from a URL( like the code below)and reads the XML document.But I dont know how to make the program keep on polling so that I can get the XML document continuosly or at some intervals . Any links or suggestions? Code:- Dim reader As XmlTextReader = New XmlTextReader("http://192.168.10.12/cgi-bin/dataProxy?oper=queryTags&map=1") While reader.Read() { .... }
Like Dave said you can use a timer that fires repeatedly at the interval you specify. Another option would be to create a file watcher service (go a google search on it). Lots of examples of how to implement one.
Any suggestions, ideas, or 'constructive criticism' are always welcome. "There's no such thing as a stupid question, only stupid people." - Mr. Garrison