Ejemplo n.º 1
0
        private CookieCollection Logon(ULAccount ulAccount, WebProxy webProxy)
        {
            // this is what we are sending
            string post_data = "id=" + ulAccount.Username + "&pw=" + ulAccount.Password;

            // this is where we will send it
            string uri = "https://uploaded.net/io/login";

            // create a request
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
            request.KeepAlive = false;
            request.ProtocolVersion = HttpVersion.Version10;
            request.Method = "POST";

            // turn our request string into a byte stream
            byte[] postBytes = Encoding.ASCII.GetBytes(post_data);

            //Proxy
            if (webProxy != null)
                request.Proxy = webProxy;

            request.ContentType = "application/x-www-form-urlencoded";
            request.ContentLength = postBytes.Length;
            request.CookieContainer = new CookieContainer();

            Stream requestStream = request.GetRequestStream();

            // now send it
            requestStream.Write(postBytes, 0, postBytes.Length);
            requestStream.Close();

            // grab the response and print it out to the console along with the status code
            HttpWebResponse response = (HttpWebResponse)request.GetResponse();

            return response.Cookies;
        }
Ejemplo n.º 2
0
 public LinksEventArgs(List<string> listDL, WebProxy webProxy, ULAccount ulAccount)
 {
     _listDL = listDL;
     _webProxy = webProxy;
     _ulAccount = ulAccount;
 }
Ejemplo n.º 3
0
 public DownloadEventArgs(WebProxy webProxy, ULAccount ulAccount, string dlPath)
 {
     _webProxy = webProxy;
     _ulAccount = ulAccount;
     _dlPath = dlPath;
 }