开发者

WPF - Open a Web Page passing it parameters

I need to open a web page from my WPF app and also pass to the webpage certain parameters that are needed by a JavaScript function. Can I开发者_Python百科 do that?


The easiest way would be submitting the parameters via the url (GET). If you want to display the webpage inside a WPF WebBrowser control, simply do a myWebBrowser.Navigate("http://www.exapmle.com?parameter=bla&another=bli").

If you want to start the external Webbrowser, take a look at this tutorial here.

If you, on the other hand, want to send post requests directly to the website, take a look at this.


I found another way. There's a control called WebBrowser in which you can set up the property "source" with the Uri of the page you want to navigate and casting this control to (WebBrowser) can calls the function .InvokeScript("NAME OF THE FUNCTION",Object PARAMETERS). It is really useful!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜