欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

.net接收post请求,并转为字符串

程序员文章站 2022-03-13 13:36:34
Stream s = Request.InputStream; int count = 0; byte[] buffer = new byte[1024]; StringBuilder reqXml = new StringBuilder(); while ((count = s.Read(buff ......

stream s = request.inputstream;
int count = 0;
byte[] buffer = new byte[1024];
stringbuilder reqxml = new stringbuilder();
while ((count = s.read(buffer, 0, 1024)) > 0)
{
reqxml.append(encoding.utf8.getstring(buffer, 0, count));
}
s.flush();
s.close();
s.dispose();