コード例 #1
0
        internal static IsolatedCookieContainer Create(string id)
        {
            var d = isolatedCookieContainerIds.TryGetNullableValue(id).GetValueOrDefault();

            d++;
            isolatedCookieContainerIds[id] = d;
            if (d != 1)
            {
                id += "?" + d;
            }

            var isolatedCookies = new IsolatedCookieContainer();

            isolatedCookies.CacheVaryKey = id;
            var p = isolatedCookies.GetCachePath();

            if (p != null)
            {
                var f = Caching.TryReadCacheFile(p);
                if (f != null)
                {
                    isolatedCookies._cookies             = f.Cookies;
                    isolatedCookies.LastPersistedCookies = f.Cookies.ToDictionary(x => x.Key, x => x.Value);
                }
            }
            return(isolatedCookies);
        }
コード例 #2
0
        internal static IsolatedCookieContainer Create(string id)
        {
            var d = isolatedCookieContainerIds.TryGetNullableValue(id).GetValueOrDefault();
            d++;
            isolatedCookieContainerIds[id] = d;
            if (d != 1)
            {
                id += "?" + d;
            }

            var isolatedCookies = new IsolatedCookieContainer();
            isolatedCookies.CacheVaryKey = id;
            var p = isolatedCookies.GetCachePath();
            if (p != null)
            {
                var f = Caching.TryReadCacheFile(p);
                if (f != null)
                {
                    isolatedCookies._cookies = f.Cookies;
                    isolatedCookies.LastPersistedCookies = f.Cookies.ToDictionary(x => x.Key, x => x.Value);
                }
            }
            return isolatedCookies;
        }