This repository has been archived by the owner on Nov 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
zekroTJA
committed
Jul 11, 2016
1 parent
5c67024
commit 8f92b56
Showing
17 changed files
with
219 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Net; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Forms; | ||
|
||
namespace meautosd | ||
{ | ||
static class cPush | ||
{ | ||
public static void send(string token, string title, string body) | ||
{ | ||
try | ||
{ | ||
WebRequest request = WebRequest.Create("https://api.pushbullet.com/v2/pushes"); | ||
request.Method = "POST"; | ||
request.Headers.Add("Authorization", "Bearer " + token); | ||
request.ContentType = "application/json; charset=UTF-8"; | ||
string postData = | ||
"{\"type\": \"link\", \"title\": \"" + title + "\", \"body\": \"" + body + "\", \"url\": \"\"}"; | ||
byte[] byteArray = Encoding.UTF8.GetBytes(postData); | ||
request.ContentLength = byteArray.Length; | ||
Stream dataStream = request.GetRequestStream(); | ||
dataStream.Write(byteArray, 0, byteArray.Length); | ||
dataStream.Close(); | ||
} | ||
catch | ||
{ | ||
MessageBox.Show("There accoured an error whilesending the push notification! Do you have entered a valid token?", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.