无法在wp7中的httpwebrequest中添加cookie标头 [英] unable to add cookie header in httpwebrequest in wp7
问题描述
public public
void
AccDetialsGetResponse() AccDetialsGetResponse() {
尝试 {
// CookieContainer cc1 = new CookieContainer(); CookieCollection CookieCollection
collection = new
CookieCollection
(); ();
SESSIONID = SESSIONID.Replace( SESSIONID = SESSIONID.Replace( " ;; Path = /" , "; Path=/",
""
); );
Cookie Cookie
cook = new
Cookie
(); ();
cook.Name = cook.Name = " cookie" "cookie"
; ; cook.Value = SESSIONID; cook.Value = SESSIONID; collection.Add(cook); collection.Add(cook);
// cc1.Add(new Uri(strHttpsUrl),cccs); HttpWebRequest
< span style ="font-family:Consolas;颜色:#0000ff; font-size:x-small"> < span style ="font-family:Consolas; color:#0000ff; font-size:x-small"> void
collection = new
CookieCollection
""
cook = new
Cookie
req =( < span style ="font-family:Consolas; color:#2b91af; font-size:x-small"> HttpWebRequest
HttpWebRequest req = (HttpWebRequest)HttpWebRequest
。创建(strHttpsUrl);
.Create(strHttpsUrl);
req.ContentType =
req.ContentType =
" text / xml; charset = \" utf-8 \""
"text/xml;charset=\"utf-8\""
;
;
req.Accept =
req.Accept =
" text / xml"
"text/xml"
;
;
req.Method =
req.Method =
" POST"
"POST"
;
;
req.CookieContainer =
req.CookieContainer =
new
CookieContainer
new CookieContainer
();
();
req.CookieContainer.Add(
req.CookieContainer.Add(
new
Uri
new Uri
(strHttpsUrl),collection);
(strHttpsUrl), collection);
req.BeginGetRequestStream(AccDetailsPostRequest,req);
}
错误:未找到远程服务器
推荐答案
您好,
请在Windows Phone 7论坛中尝试您的查询,因为此论坛专门用于Windows Mobile ..
Please try your query in Windows Phone 7 forums as this forums is dedicated to Windows Mobile..
这篇关于无法在wp7中的httpwebrequest中添加cookie标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!