码迷,mamicode.com
首页 > Windows程序 > 详细

C#访问url地址并返回数据

时间:2015-05-08 16:21:27      阅读:145      评论:0      收藏:0      [点我收藏+]

标签:

 public string getPostBackStream(string rUrl)
        {

            WebClient myWebClient = new WebClient();

            NameValueCollection myNameValueCollection = new NameValueCollection();
            myNameValueCollection.Add("title", "this is title");

            myNameValueCollection.Add("excerpt", "this is excerpt");
            byte[] responseArray = myWebClient.UploadValues(rUrl, "POST", myNameValueCollection);
            return Encoding.ASCII.GetString(responseArray);
        }

  

C#访问url地址并返回数据

标签:

原文地址:http://www.cnblogs.com/zzq-include/p/4487990.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!