Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- byte[] encbuff = System.Text.Encoding.UTF8.GetBytes("the string");
- String enc = Convert.ToBase64String(encbuff);
- $data = $_REQUEST['in'];
- $raw = base64_decode($data);
- byte[] encbuff = System.Text.Encoding.UTF8.GetBytes("the string");
- string enc = Convert.ToBase64String(encbuff);
- string urlenc = Server.UrlEncode(enc);
- $data = $_REQUEST['in'];
- $decdata = urldecode($data);
- $raw = base64_decode($decdata);
- byte[] bytes = new byte[1000];
- Console.WriteLine(Convert.ToBase64String(bytes));
- this is a <B>long</b>string. and lets make this a3214 ad0-3214 0czcx 909340 zxci 0324#$@#$%%13244513123
- dGhpcyBpcyBhIDxCPmxvbmc8L2I+c3RyaW5nLiBhbmQgbGV0cyBtYWtlIHRoaXMgYTMyMTQgYWQwLTMyMTQgMGN6Y3ggOTA5MzQwIHp4Y2kgMDMyNCMkQCMkJSUxMzI0NDUxMzEyMw==
- private string HTTPPost(string URL, Dictionary<string, string> FormData)
- {
- UTF8Encoding UTF8encoding = new UTF8Encoding();
- string postData = "";
- foreach (KeyValuePair<String, String> entry in FormData)
- {
- postData += entry.Key + "=" + entry.Value + "&";
- }
- postData = postData.Remove(postData.Length - 1);
- //urlencode replace (+) with (%2B) so it will not be changed to space ( )
- postData = postData.Replace("+", "%2B");
- byte[] data = UTF8encoding.GetBytes(postData);
- HttpWebRequest request = (HttpWebRequest)WebRequest.Create(URL);
- request.Method = "POST";
- request.ContentType = "application/x-www-form-urlencoded";
- request.ContentLength = data.Length;
- Stream strm = request.GetRequestStream();
- // Send the data.
- strm.Write(data, 0, data.Length);
- strm.Close();
- WebResponse rsp = null;
- // Send the data to the webserver
- rsp = request.GetResponse();
- StreamReader rspStream = new StreamReader(rsp.GetResponseStream());
- string response = rspStream.ReadToEnd();
- return response;
- }
Add Comment
Please, Sign In to add comment