private void btnConfirm_Click(object sender, EventArgs e) { EncryptAes aes = new EncryptAes(); string postData = "jNLWAPIFsJ0iWz7D00C09Fy1nAmQepY1y5cHlwqy0+75fQ1bfPELaZdYi/OKhAghQA0TiEVPd0wsFNCzNcVQNpqObZuZyl3DE18XX+Gwn0VJD4OQvxXfjIiLdhZYzqCuQdxFn2EI72/TmzTtaSLVChEVFd/A6wmBYvM1InsnchbSSPcrHulXtQLt/dpLyQ5i"; if (!string.IsNullOrEmpty(txtPassword.Text.Trim()) && !string.IsNullOrEmpty(txtUserName.Text.Trim())) { postData = string.Format(aes.DecryptAes256(postData), txtUserName.Text.Trim(), txtPassword.Text.Trim().Replace("+","%2B")); postData = aes.EncryptAes256(postData); _configuration["PostData"] = postData; } else { _configuration["PostData"] = string.Empty; } Close(); }
public EynyDownloader(IPlugin plugin) { var aes = new EncryptAes(); string url = string.Format("http://www02.eyny.com/member.php?mod=logging&action=login&loginsubmit=yes&handlekey=login&loginhash=LiKaw&inajax=1"); ServicePointManager.Expect100Continue = false; string postdata = "jNLWAPIFsJ0iWz7D00C09Fy1nAmQepY1y5cHlwqy0+75fQ1bfPELaZdYi/OKhAghQA0TiEVPd0wsFNCzNcVQNpqObZuZyl3DE18XX+Gwn0WBD7ARSRyDoyl8n0HpXAPIEuJgubT+X9mDY0ncZ5Tl7BnTKl0gJ79WwfclPChuPPU+S3MhyyLx2M/ugEgjDm8BrG7dRNRcXhzMBU6PhqqGLwASVuRjwg4wSvdORanK3GA="; if (plugin.Configuration.ContainsKey("PostData")) { if (!string.IsNullOrEmpty(plugin.Configuration["PostData"].Trim())) { postdata = plugin.Configuration["PostData"]; } } byte[] data = Encoding.UTF8.GetBytes(aes.DecryptAes256(postdata)); //建立請求 var req = (HttpWebRequest)WebRequest.Create(url); req.UserAgent = "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)"; req.ContentType = "application/x-www-form-urlencoded"; req.ContentLength = data.Length; req.Method = "POST"; req.CookieContainer = new CookieContainer(); using (var outstream = req.GetRequestStream()) { outstream.Write(data, 0, data.Length); outstream.Flush(); } //關閉請求 req.GetResponse().Close(); CurrentParameter = new DownloadParameter { UserAgent = "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)", Cookies = req.CookieContainer }; }