1. public static string Post(string PostUrl, string Parameters)
    2. {
    3. string content = string.Empty;
    4. try
    5. {
    6. byte[] bytesRequestData = Encoding.UTF8.GetBytes(Parameters);
    7. HttpWebRequest myReq = (HttpWebRequest)HttpWebRequest.Create(PostUrl);
    8. myReq.Method = "post";
    9. myReq.ContentType = "applicatin/x-www-for-urlencoded";
    10. myReq.ContentLength = bytesRequestData.Length;
    11. Stream requestStream = myReq.GetRequestStream();
    12. requestStream.Write(bytesRequestData, 0, bytesRequestData.Length);
    13. requestStream.Close();
    14. HttpWebResponse HttpWResp = (HttpWebResponse)myReq.GetResponse();
    15. Stream myStream = HttpWResp.GetResponseStream();
    16. StreamReader reader = new StreamReader(myStream,Encoding.UTF8);
    17. content = reader.ReadToEnd();
    18. reader.Close();
    19. HttpWResp.Close();
    20. }
    21. catch (Exception ex)
    22. {
    23. content = ex.ToString();
    24. }
    25. return content;
    26. }