看板Programming
标 题Re: asp.net网页 如何post资料到asp,jsp,php网页上?
发信站SayYA 资讯站 (Tue May 30 10:22:05 2006)
转信站ptt!ctu-reader!news.nctu!SayYa
※ 引述《leicheong (理昌)》之铭言:
> ※ 引述《[email protected] (~翔~)》之铭言:
> > asp.net中的post似乎只能用来传资料给自己网页,变成实现asp.net物件导向的手段...
> > asp.net网页间传资料可以用session or cookie or get,但是好像没有在用post
> > 我的问题是人家的公司jsp网页已经写好,规定只能用post传资料过去,
> > asp.net的网页如何跟他连通?
> > google後找到人家写的方法:
> > System.Net.WebClient web =new System.Net.WebClient();
> > web.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
> > byte[] d = new byte[100] ;
> > d=System.Text.Encoding.ASCII.GetBytes("SEARCHSTRING=test1");
> > byte[] res = new byte [100];
> > res = web.UploadData("http://xxx.com.tw/xxx.jsp", "POST", d);
> ^^^^^^^
> > Label1.Text = System.Text.Encoding.ASCII.GetString(res);
> > 可是我要连的网页因为有ssl加密,用这方法会出现"certificate is invalid "
> SSL没有试过, 但是用HTTPS连线的话这里不是应该用"https://"的吗?
简单找了一下, 你需要 1) 在机器的root store加入自己的CA certificate; 或
2) 使用ICertificatePolicy(以下是mono的范例):
http://bugzilla.ximian.com/showattachment.cgi?attach_id=13163
--
※ Origin: SayYA 资讯站 <bbs.sayya.org>
◆ From: ip-84-126-134-202.rev.dyxnet.com