Page 1 of 1

C# Beispielcode

Posted: 7. Sep 2021, 08:58
by MuratB35
Sehr geehrte Mitglieder,

ich bin noch relativ neu in PushNotification services. Ich wollte über einen C# Script an meine Geräte Notifications via WebRequest schicken,
jedoch kann ich mit dem Beispielcode auf der Website nicht viel anfangen. Hat jemand einen kompletten Beispielcode für ein C# Script?

Vielen Dank im Voraus !

Re: C# Beispielcode

Posted: 7. Sep 2021, 12:49
by admin
hier ein Beispiel, welches sofort funktionieren sollte:

Code: Select all

using System.Net;
using System.Collections.Specialized;
var options= new NameValueCollection {
		{ "t", "Mein Titel" },
		{ "m", "Meine Nachricht" },
		{ "s", "5" },
		{ "v", "3" },
		{ "i", "15" },
		{ "c", "#FF0000" },
		{ "d", "a" },
		{ "u", "https://www.pushsafer.com" },
		{ "ut", "Open Pushsafer" },
		{ "k", "PrivateKey" }
};
using (var client = new WebClient())
{
    client.UploadValues("https://www.pushsafer.com/api", options);
}

Re: C# Beispielcode

Posted: 7. Sep 2021, 20:22
by MuratB35
Super danke dir !