Ejemplo n.º 1
0
    public string GenerateCookieList(URI AUri, bool SecureConnection) {
      string S = "";
      CookieList LCookieList;
      SortedList<string, string> LResultList;
      CleanupCookieList();
      lock (_Cookies.GetCookieListByDomain()) {
        if (_Cookies.GetCookieListByDomain().Count > 0) {
          LResultList = new SortedList<string,string>();
          for (int i = 0; i < _Cookies.GetCookieListByDomain().Count; i++) {
            if (_Cookies.GetCookieListByDomain().IndexOfKey(AUri.Host) > 0) {
              LCookieList = (CookieList)_Cookies.GetCookieListByDomain()[AUri.Host];
              for (int j = 0; j < LCookieList.Count; i++) {
                if (LCookieList.Cookie(j).Path.IndexOf(AUri.Path) == 0) {
                  if ((LCookieList.Cookie(j).Secure || SecureConnection)
                    && (LCookieList.Cookie(j).Value != "")) {
                    LResultList.Add(LCookieList.Cookie(j).CookieName, LCookieList.Cookie(j).Value);
                  }
                }
              }
            }
          }
          for (int i = LResultList.Count; i > 0; i--) {
            if (S.Length > 0) {
              S += "; ";
            }
            S += LResultList.Keys[i] + "=" + LResultList.Values[i];
          }

        }
      }
      return S;
    }
Ejemplo n.º 2
0
 public string GenerateCookieList(URI AUri) {
   return GenerateCookieList(AUri, false);
 }
Ejemplo n.º 3
0
 public static string URLEncode(string ASrc)
 {
   URI TempUri = new URI(ASrc);
   {
     TempUri.Path = PathEncode(TempUri.Path);
     TempUri.Document = PathEncode(TempUri.Document);
     TempUri.Params = ParamsEncode(TempUri.Params);
     return TempUri.URIString;
   }
 }