我正在使用C#和Windows Phone 8.1作为通用。
我使用此代码将cookieContainer设置为HttpWebRequest并访问我的网站。
CookieContainer cookieContainer = new CookieContainer();
public async Task<string> Begin(string url, bool saveCookie = false)
{
string pageSource = "";
HttpWebRequest request;
request = (HttpWebRequest)WebRequest.Create(url);
//request.Method = "Get";
if (cookieContainer != null && saveCookie)
request.CookieContainer = cookieContainer;
try
{
HttpWebResponse response = (HttpWebResponse)await request.GetResponseAsync();
pageSource = new StreamReader(response.GetResponseStream()).ReadToEnd();
pageSource = System.Net.WebUtility.HtmlDecode(pageSource);
}
catch { }
return pageSource;
}
现在我必须使用Phone Web Browser {Internet Explorer}(forPayment页面)打开一个URL。如何将这个CookieContainer的网址发布到IE?
我也知道这段代码可以启动网址&gt;
var options = new Windows.System.LauncherOptions();
options.TreatAsUntrusted = false;
await Windows.System.Launcher.LaunchUriAsync(new Uri("url"), options);
感谢。