Inheritance: System.Net.WebClient
Esempio n. 1
0
 private void PerformLogin()
 {
     try
     {
         using (var client = new GhostWebClient())
         {
             client.Login(GetUrl("/ghost/signin/"), GetUrl("/ghost/"), Login, Password);
             _token = client.Tag;
             _cookie = client.ConnSid;
             if (_cookie != null)
                 _cookie.Path = _cookiePath;
         }
     }
     catch (WebException exception)
     {
         if ((int)((HttpWebResponse)exception.Response).StatusCode == 403)
             throw new GhostWrongUsernamePasswordException();
         throw;
     }
 }
Esempio n. 2
0
 private void PerformLogin()
 {
     try
     {
         using (var client = new GhostWebClient())
         {
             client.Login(GetUrl("/ghost/signin/"), GetUrl("/ghost/"), Login, Password);
             _token  = client.Tag;
             _cookie = client.ConnSid;
             if (_cookie != null)
             {
                 _cookie.Path = _cookiePath;
             }
         }
     }
     catch (WebException exception)
     {
         if ((int)((HttpWebResponse)exception.Response).StatusCode == 403)
         {
             throw new GhostWrongUsernamePasswordException();
         }
         throw;
     }
 }