标题:c# winform 提交网页信息 求帮助
只看楼主
boyplay
Rank: 1
等 级:新手上路
帖 子:6
专家分:5
注 册:2010-4-12
 问题点数:0 回复次数:0 
c# winform 提交网页信息 求帮助
c# winform 代码 按钮点击后执行

string strUrl = "h-t-t-p://此处省略/test.asp?id=" + ID + "&pwd=" + PWD + "&num=" + num + "&city=上海&to=无锡&company=南京&address=无锡无锡地址&date=2008-08-08";

                Uri uri = new Uri(strUrl);
                WebRequest wr = WebRequest.Create(uri);
                Stream s = wr.GetResponse().GetResponseStream();
                StreamReader sr = new StreamReader(s, Encoding.GetEncoding("GB2312"));
                string all = sr.ReadToEnd();
                return all;



test.asp 代码

   set rs3= server.CreateObject("ADODB.recordset")
   rs3.open sql3,conn,1,3
   rs3.addnew
   rs3("uid") = uid
   rs3("company") = company
   rs3("num") = num
   rs3("fcity") = city
   rs3("tcity") = tocity
   rs3("date") = date2
   rs3("state") = 1
   rs3("address") = "地址:"&address&""
   rs3.update
   rs3.close
   set rs3 = nothing



'response.Write("地址:"&address&"")  网页打开连接显示中文,但是asp插到sql数据就是乱码
搜索更多相关主题的帖子: 无锡 address company 上海 
2012-08-22 11:25



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-379910-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.026464 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved