summaryrefslogtreecommitdiffstats
path: root/extra/push-examples/csharp/index.cs
diff options
context:
space:
mode:
Diffstat (limited to 'extra/push-examples/csharp/index.cs')
-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);
+ }
+ }
+}