Click here to Skip to main content
15,748,477 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Dear All,

am working on c#,

Iam reading Xml file using url,, its working fine.

I have two buttons on my page as ON and OFF.

When i click on ON button, the status of the xml file relay states will be 1


and when i click OFF the status of the XML file relay states will be 0


Now, i want to put 10 seconds timer between these 0 and 1
When i click ON button it should be 1 and after 10 seconds it should be 0, same thing must be continued.

Please help.

This is my code for 10 seconds

string url = "";
XmlDocument xmlDoc = new XmlDocument();


1 solution

Hi You can try to create method in separate thread on your server side code which will call same method as your OFF button. when you receive ON request you need to start the method in separate thread and put Thread.Sleep with 10 seconds.
In this case after 10 seconds the thread will continue his work and will call OFF method.

Hope this will help
Best Regards
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900