如何在cookiecontainer中访问cookie

时间:2018-08-25 19:58:05

标签: c# cookies

我在递归cookie容器的PHPSSID值时遇到麻烦...我该怎么做?

Debug Info

获取该值的路径:

m_domainTable = Count = 1
   [".biz.nf"] = {System.Net.PathList}
      (new System.Collections.Hashtable.HashtableDebugView(client.CookieContainer.m_domainTable).Items[0]).Value
       m_list = Count = 1
           ["/"] = {System.Net.CookieCollection}
                m_list = Count = 2
                  [0] = {PHPSESSID=q40djhd9ldu7sh27561nvgia22}

谢谢

@EDIT

我刚刚在这里How can I get all Cookies of a CookieContainer?

找到了篷
var allCokies = cookieContainer.GetAllCookies();
var phpSsid = allCokies.FirstOrDefault(x=>x.Name.Contains("PHP")).Value

0 个答案:

没有答案