mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-07-20 13:38:50 -04:00
Push Examples (#3735)
This commit is contained in:
parent
9c24cd3973
commit
9ef1e69ae0
13 changed files with 178 additions and 0 deletions
24
extra/push-examples/csharp/index.cs
Normal file
24
extra/push-examples/csharp/index.cs
Normal file
|
@ -0,0 +1,24 @@
|
|||
using System;
|
||||
using System.Net;
|
||||
using System.Threading;
|
||||
|
||||
/**
|
||||
* Compile: C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe index.cs
|
||||
* Run: index.exe
|
||||
*/
|
||||
class Index
|
||||
{
|
||||
const string PushURL = "https://example.com/api/push/key?status=up&msg=OK&ping=";
|
||||
const int Interval = 60;
|
||||
|
||||
static void Main(string[] args)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
WebClient client = new WebClient();
|
||||
client.DownloadString(PushURL);
|
||||
Console.WriteLine("Pushed!");
|
||||
Thread.Sleep(Interval * 1000);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue