Reputation: 427
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 ?
Upvotes: 2
Views: 1013
Reputation: 2625
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
P.S. 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#
Upvotes: 1