Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Net;
- using System.Net.Http;
- using Newtonsoft.Json;
- using Newtonsoft.Json.Linq;
- namespace Alarm
- {
- class Program
- {
- static void Main(string[] args)
- {
- DateTime timeNow = DateTime.Now;
- while(true)
- {
- if(timeNow.Hour.ToString() + timeNow.Minute.ToString() == "2245")
- {
- Req();
- Console.WriteLine("Done");
- break;
- }
- }
- }
- static async void Req()
- {
- using (var httpClient = new HttpClient())
- {
- using (var request = new HttpRequestMessage(new HttpMethod("POST"), "http://192.168.0.247/1/off"))
- {
- var response = await httpClient.SendAsync(request);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement