R
Rachet?
I am getting "Error:The underlying connection was closed:Unable to
connect to the remote server." when I try to excute the following from
a Windows Forms app. I have no problem from a browser app. By the way
the site I actually use is different from the one shown here. The
error happens at GetRequestStream() call. Is it not allowed to
interact with a classic asp page from .NET? Or what did I miss here?
Any help is appreciated.
WebRequest httpReq =
(HttpWebRequest)WebRequest.Create("http://justtest.moc/test.asp");
httpReq.Method = "POST";
httpReq.ContentType = "application/x-www-form-urlencoded";
httpReq.Timeout = 100000;
byte[] encodedRequest = Encoding.UTF8.GetBytes(strPost);
httpReq.ContentLength = encodedRequest.Length;
using (Stream requestStream = httpReq.GetRequestStream())
{
requestStream.Write(encodedRequest, 0, encodedRequest.Length);
requestStream.Close();
}
connect to the remote server." when I try to excute the following from
a Windows Forms app. I have no problem from a browser app. By the way
the site I actually use is different from the one shown here. The
error happens at GetRequestStream() call. Is it not allowed to
interact with a classic asp page from .NET? Or what did I miss here?
Any help is appreciated.
WebRequest httpReq =
(HttpWebRequest)WebRequest.Create("http://justtest.moc/test.asp");
httpReq.Method = "POST";
httpReq.ContentType = "application/x-www-form-urlencoded";
httpReq.Timeout = 100000;
byte[] encodedRequest = Encoding.UTF8.GetBytes(strPost);
httpReq.ContentLength = encodedRequest.Length;
using (Stream requestStream = httpReq.GetRequestStream())
{
requestStream.Write(encodedRequest, 0, encodedRequest.Length);
requestStream.Close();
}