public class Public
{
private static Public _instance = new Public(); /// <summary>
/// 全局访问点
/// </summary>
public static Public Instance
{
get
{
return _instance;
}
} /// <summary>
/// 解析post流数据
/// </summary>
/// <returns></returns>
public string ShowUrlPostData()
{
try
{
Stream s = HttpContext.Current.Request.InputStream;
byte[] result_byte = new byte[];
MemoryStream ms = new MemoryStream();
int count = s.Read(result_byte, , result_byte.Length);
while (count != )
{
ms.Write(result_byte, , count);
count = s.Read(result_byte, , result_byte.Length);
}
string json_result = HttpUtility.UrlDecode(Encoding.UTF8.GetString(ms.ToArray())).Trim('=');
return json_result;
}
catch { }
return "";
}
}