Exemplo n.º 1
0
        public static FPLoginForm GetFPLoginForm()
        {
            if (fpLoginForm == null)
            {
                WinInetHelper.SupressCookiePersist();
                WinInetHelper.EndBrowserSession();
                fpLoginForm = new FPLoginForm();
            }

            return(fpLoginForm);
        }
Exemplo n.º 2
0
        public static string GetCookieValue(Uri uri, string key)
        {
            var rtnValue = "";
            var findKey  = key + "=";

            var cookieContainer = WinInetHelper.GetUriCookieContainer(uri);

            foreach (var oneCookie in cookieContainer.GetCookies(uri))
            {
                var cookieText = oneCookie.ToString();
                if (cookieText.Length > findKey.Length && cookieText.Substring(0, findKey.Length) == findKey)
                {
                    rtnValue = cookieText.Substring(findKey.Length);
                    break;
                }
            }
            return(rtnValue);
        }