Skip to content

Instantly share code, notes, and snippets.

Avatar

Paul paulvonlecter

View GitHub Profile
@paulvonlecter
paulvonlecter / bitmask.php
Created Nov 7, 2017
Stupid case to process bitmask on PHP
View bitmask.php
<?php
// source data
$source = array(
false,
true,
true,
false,
true,
true,
false,
@paulvonlecter
paulvonlecter / get-post-functions.cs
Created Mar 30, 2017
GET & POST requests' functions in C#
View get-post-functions.cs
private static string POST(string Url, string Data) {
System.Net.WebRequest req = System.Net.WebRequest.Create(Url);
req.Method = "POST";
req.Timeout = 100000;
req.ContentType = "application/x-www-form-urlencoded";
// Кодировка указывается в зависимости от кодировки клиента
byte[] sentData = Encoding.GetEncoding(1251).GetBytes(Data);
req.ContentLength = sentData.Length;
System.IO.Stream sendStream = req.GetRequestStream();
sendStream.Write(sentData, 0, sentData.Length);
You can’t perform that action at this time.