无法在wp7中的httpwebrequest中添加cookie标头 [英] unable to add cookie header in httpwebrequest in wp7

查看:80
本文介绍了无法在wp7中的httpwebrequest中添加cookie标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


 

 

public
< span style ="font-family:Consolas;颜色:#0000ff; font-size:x-small"> < span style ="font-family:Consolas; color:#0000ff; font-size:x-small"> void

public void

AccDetialsGetResponse()

AccDetialsGetResponse()

{

 

尝试

{

 

// CookieContainer cc1 = new CookieContainer();

 

CookieCollection
collection =
new
CookieCollection

CookieCollection collection = new CookieCollection

();

();

SESSIONID = SESSIONID.Replace(

SESSIONID = SESSIONID.Replace(

" ;; Path = /"
""

"; Path=/", ""

);

);

 

Cookie
cook =
new
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
req =(
< span style ="font-family:Consolas; color:#2b91af; font-size:x-small"> HttpWebRequest 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..

Windows Phone 7的社区论坛


这篇关于无法在wp7中的httpwebrequest中添加cookie标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆