UWP从网站获取cookie

时间:2016-03-15 15:50:38

标签: windows cookies mobile webview win-universal-app

我在Windows 10移动应用中使用WebView。

用户在WebView的网页上输入凭据后,会发生重定向。当重定向到的网页已加载时,我将获得一个cookie以获取令牌。

我查看了WebView,但找不到任何关于cookie的信息。

是否可以从WebView获取Cookie?

我查看了Windows.Web.Http.HttpClient,发现应该可以使用HttpClient检索cookie。 是Windows.Web.Http.HttpClient的方法吗?如果是这样,我应该如何使用HttpClient从WebView获取cookie?

帮助表示感谢,谢谢!

1 个答案:

答案 0 :(得分:4)

重定向后,在您的应用中使用g <- function(x, n, ties = c('first','random','last')) { ties <- match.arg(ties) FUN <- switch(ties, first = min, last = max, random = function(x) x[sample.int(length(x), 1)]) y <- rle(x) y$values <- y$lengths * y$values y <- inverse.rle(y) z <- rep_len(0, length(x)) if (!length(wh <- which(y == n))) return(z) wh <- wh[seq_along(wh) %% n == 0] z[FUN(wh)] <- 1 z } x <- c(0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1) g(x, 1, 'first') # [1] 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 g(x, 1, 'last') # [1] 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 g(x, 1, 'random') # [1] 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 g(x, 4) # [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ,您可以获取重定向网址的Cookie,如下所示:

WebBrowser
相关问题