summaryrefslogtreecommitdiffstats
path: root/extra/push-examples/csharp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2024-11-26 09:28:28 +0100
committerDaniel Baumann <daniel@debian.org>2024-11-26 12:25:58 +0100
commita1882b67c41fe9901a0cd8059b5cc78a5beadec0 (patch)
tree2a24507c67aa99a15416707b2f7e645142230ed8 /extra/push-examples/csharp
parentInitial commit. (diff)
downloaduptime-kuma-upstream.tar.xz
uptime-kuma-upstream.zip
Adding upstream version 2.0.0~beta.0+dfsg.upstream/2.0.0_beta.0+dfsgupstream
Signed-off-by: Daniel Baumann <daniel@debian.org>
Diffstat (limited to 'extra/push-examples/csharp')
-rw-r--r--extra/push-examples/csharp/index.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/extra/push-examples/csharp/index.cs b/extra/push-examples/csharp/index.cs
new file mode 100644
index 0000000..94eecfb
--- /dev/null
+++ b/extra/push-examples/csharp/index.cs
@@ -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);
+ }
+ }
+}