G
Guest
i use WebRequest to read response from the URL i request.
the HTML returned contain an HTML buttons which do post back to server,
after many time "HTTP 403.9 - Access Forbidden: Too many users are connected".
this is snapshot of the code:
System.Net.WebRequest request =
System.Net.HttpWebRequest.Create("http://192.168.0.12:8888/XXXX");
request.ContentType = @"application/x-www-form-urlencoded";
request.Credentials =
System.Net.CredentialCache.DefaultCredentials;
System.Text.StringBuilder ActionsBuilder = new
StringBuilder();
request.Method = "POST";
System.Net.ServicePointManager.Expect100Continue = false;
((System.Net.HttpWebRequest)request).KeepAlive = false;
byte[] postBuffer =
System.Text.Encoding.GetEncoding(1252).GetBytes(Parameters);
request.ContentLength = postBuffer.Length;
System.IO.Stream postDataStream = request.GetRequestStream();
postDataStream.Write(postBuffer, 0, postBuffer.Length);
postDataStream.Close();
System.Net.HttpWebResponse response =
(System.Net.HttpWebResponse)request.GetResponse();
Encoding enc = System.Text.Encoding.UTF8;
System.IO.StreamReader responseStream = new
System.IO.StreamReader(response.GetResponseStream(), enc, false);
StringBuilder responseHtml = new StringBuilder();
responseHtml.Append(responseStream.ReadToEnd());
response.Close();
responseStream.Close();
request.Abort();
please advise
the HTML returned contain an HTML buttons which do post back to server,
after many time "HTTP 403.9 - Access Forbidden: Too many users are connected".
this is snapshot of the code:
System.Net.WebRequest request =
System.Net.HttpWebRequest.Create("http://192.168.0.12:8888/XXXX");
request.ContentType = @"application/x-www-form-urlencoded";
request.Credentials =
System.Net.CredentialCache.DefaultCredentials;
System.Text.StringBuilder ActionsBuilder = new
StringBuilder();
request.Method = "POST";
System.Net.ServicePointManager.Expect100Continue = false;
((System.Net.HttpWebRequest)request).KeepAlive = false;
byte[] postBuffer =
System.Text.Encoding.GetEncoding(1252).GetBytes(Parameters);
request.ContentLength = postBuffer.Length;
System.IO.Stream postDataStream = request.GetRequestStream();
postDataStream.Write(postBuffer, 0, postBuffer.Length);
postDataStream.Close();
System.Net.HttpWebResponse response =
(System.Net.HttpWebResponse)request.GetResponse();
Encoding enc = System.Text.Encoding.UTF8;
System.IO.StreamReader responseStream = new
System.IO.StreamReader(response.GetResponseStream(), enc, false);
StringBuilder responseHtml = new StringBuilder();
responseHtml.Append(responseStream.ReadToEnd());
response.Close();
responseStream.Close();
request.Abort();
please advise