简体   繁体   中英

Windows phone 8 web browser task

WebBrowserTask webbrowsertask = new WebBrowserTask();
            webbrowsertask.Uri = new Uri("http://johndoe/index.php?dsa=51",UriKind.Absolute);
            webbrowsertask.Show();
            NavigationService.Navigate(new Uri("Mainpage.xaml",UriKind.RelativeOrAbsolute));

webbrowsertask.Show(); is executing this code and opens browser I dont want to open browser , I just want to execute this code(got to this url , because i want this parameters to be sent in my site/database) are there any other ways ?

using System.IO;
using System.Net;

String URI = "http://somesite.com/somepage.html";

WebClient webClient = new WebClient();
Stream stream = webClient.OpenRead(URI);
String request = reader.ReadToEnd();

from here : http://www.codeproject.com/Articles/33798/HTTP-GET-with-NET-WebClient

It's raw idea but you can adapt it to whatever you like.

MSDN info: http://msdn.microsoft.com/en-us/library/system.net.webclient(v=vs.110).aspx

PS and you definitely need a POST call, rather then GET , for storing data in your service/db/whatever, as you mentioned in question.

More info: How to post data to specific URL using WebClient in C#

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM