Re: asp.net網頁 如何post資料到asp,jsp,php網頁上?

看板Programming作者時間18年前 (2006/05/30 10:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串6/12 (看更多)
※ 引述《leicheong (理昌)》之銘言: > ※ 引述《flytzeng.bbs@ptt.cc (~翔~)》之銘言: > > 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
文章代碼(AID): #14Uwwb00 (Programming)
討論串 (同標題文章)
文章代碼(AID): #14Uwwb00 (Programming)