Open Url & Set CookieContainer for phone web browser
I am using C # and Windows Phone 8.1 as Universal.
I am using this code to set a cookieContainer on HttpWebRequest and access my site.
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;
}
Now I need to open a URL with the phone's web browser {Internet Explorer} (for the checkout page). how can i trigger url with this CookieContainer in IE?
Also I know that with this code it is possible to run url>
var options = new Windows.System.LauncherOptions();
options.TreatAsUntrusted = false;
await Windows.System.Launcher.LaunchUriAsync(new Uri("url"), options);
Thank.
+3
source to share
No one has answered this question yet
Check out similar questions: