Uri uri = new Uri("https://www.hanjin.com/hanjin/CUP_HOM_3321.do?redir=Y&sessLocale=en"); string PostData = "bkgNo=" + txt_BOL.Text; string proxy = null; UTF8Encoding encoding = new UTF8Encoding(); byte[] bytes = encoding.GetBytes(PostData); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri); request.CookieContainer = new CookieContainer(); request.Method = "POST"; request.AllowWriteStreamBuffering = true; request.AuthenticationLevel = System.Net.Security.AuthenticationLevel.MutualAuthRequested; request.Credentials = CredentialCache.DefaultCredentials; request.UseDefaultCredentials = true; request.ProtocolVersion = HttpVersion.Version10; request.AllowAutoRedirect = true; request.KeepAlive = true; request.ContentLength = bytes.Length; request.ContentType = "text/html;charset=UTF-8"; request.Proxy = new System.Net.WebProxy(proxy, true); request.Accept = "*/*"; System.IO.Stream dataStream = request.GetRequestStream(); dataStream.Write(bytes, 0, bytes.Length); dataStream.Flush(); dataStream.Close(); System.Net.HttpWebResponse response = (System.Net.HttpWebResponse)request.GetResponse(); long y = response.ContentLength; string str = response.ContentType.ToString(); System.IO.Stream resst = response.GetResponseStream(); // display HTTP response System.IO.StreamReader sr = new System.IO.StreamReader(resst); string result = sr.ReadToEnd(); sr.Close(); resst.Close(); response.Close();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)