通过Win Store应用程序的代码为webview设置cookie /标题 [英] set cookies/headers for webview via code for Win Store App
问题描述
我想通过代码为我的 webview
设置Cookie。我知道这是不可能的Windows电话。但是现在是否可能在Windows 8?任何人都可以指导我?
I want to set cookies for my webview
via the code. I know it was not possible in windows phone. But is it now possible in windows 8? Can anyone guide me?
替代选项:在导航到Windows 8中的网址时,我可以传递标题吗?
Alternate Option: Can I pass Headers while navigating to a URL in windows 8?
在Windows Phone中
In windows phone
Navigate(URL, [Flags,] [TargetFrameName,] [PostData,] [Headers])
在Windows 8中
In Windows 8
Navigate(Uri source)
推荐答案
WebView控件不会为你。
Sorry but the WebView control won't do that for you.
您可以使用所需的头创建一个自定义WebRequest,然后调用WebView.NavigateToString() WebResponse的内容。
You can acomplish what you want creating a custom WebRequest with the desired headers, and then call WebView.NavigateToString() with the content of the WebResponse.
这篇关于通过Win Store应用程序的代码为webview设置cookie /标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!