如何用.net post一个连接里面的数据 企业微信怎样使用这样一个连接 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 太多了,随便先看个吧http://www.cnblogs.com/xssxss/archive/2012/07/03/2574554.html httpwebrequest public string PostUrl() { string url="你的url";string data="你的 数据"; System.Net.HttpWebRequest httpWebRequest = (HttpWebRequest)System.Net.WebRequest.Create(url); httpWebRequest.Method = "POST"; httpWebRequest.Headers.Add("Accept-Charset", "utf-8"); byte[] postBytes = Encoding.UTF8.GetBytes(data); //httpWebRequest.ContentType = "text/xml"; httpWebRequest.ContentType = "application/json; charset=utf-8";// httpWebRequest.ContentLength = Encoding.UTF8.GetByteCount(data);//strJson为json字符串 Stream stream = httpWebRequest.GetRequestStream(); stream.Write(postBytes, 0, postBytes.Length); stream.Close();//发送完毕,接受返回值 var response = httpWebRequest.GetResponse(); Stream streamResponse = response.GetResponseStream(); StreamReader streamRead = new StreamReader(streamResponse); String responseString = streamRead.ReadToEnd(); return responseString; }/// <summary> /// 获取 Post 提交的参数 /// </summary> /// <returns></returns> public string getPostStr() { Int32 intLen = Convert.ToInt32(Request.InputStream.Length); byte[] b = new byte[intLen]; Request.InputStream.Read(b, 0, intLen); return System.Text.Encoding.UTF8.GetString(b); } 将表格行加入表格中 关于GridView的一个问题。 asp.net 里如何实现当输入完用户名后,光标定位到下一个文本框时,进行用户名检查? 用Visual C#调用Windows API函数 内网服务器上安装了一套新闻发布系统,如何用它来管理多个外网网站??? asp.net 插入数据库数据 ASP.NET和数据库交互的相关思路。 绑定 GridView 的问题? 在treeview中读取数据库的数据 ----在网页中如何使用消息框---- 大数据加载优化 entity frame extend Delete()方法出错
{
string url="你的url";
string data="你的 数据";
System.Net.HttpWebRequest httpWebRequest = (HttpWebRequest)System.Net.WebRequest.Create(url);
httpWebRequest.Method = "POST"; httpWebRequest.Headers.Add("Accept-Charset", "utf-8"); byte[] postBytes = Encoding.UTF8.GetBytes(data);
//httpWebRequest.ContentType = "text/xml";
httpWebRequest.ContentType = "application/json; charset=utf-8";// httpWebRequest.ContentLength = Encoding.UTF8.GetByteCount(data);//strJson为json字符串
Stream stream = httpWebRequest.GetRequestStream();
stream.Write(postBytes, 0, postBytes.Length);
stream.Close();//发送完毕,接受返回值
var response = httpWebRequest.GetResponse();
Stream streamResponse = response.GetResponseStream();
StreamReader streamRead = new StreamReader(streamResponse);
String responseString = streamRead.ReadToEnd();
return responseString; }/// <summary>
/// 获取 Post 提交的参数
/// </summary>
/// <returns></returns>
public string getPostStr()
{
Int32 intLen = Convert.ToInt32(Request.InputStream.Length);
byte[] b = new byte[intLen];
Request.InputStream.Read(b, 0, intLen);
return System.Text.Encoding.UTF8.GetString(b);
}