S
Sonnich Jensen
I have tried a number of ways and I get this error:
The server committed a protocol violation. Section=ResponseStatusLine
I am reading a CSV file from a deprag controller running linux.
My code on win7 is as follows:
textBox2.Text = "starting...";
try
{
HttpWebRequest request =
(HttpWebRequest)WebRequest.Create(textBox1.Text);
textBox1.Text = http://200.200.200.101/cgi-bin/cgiread?site=13&dlfile=/mnt/mmc/finaldata/Actual.csv
// Set some reasonable limits on resources used by
this request
request.ServicePoint.Expect100Continue = false;
request.MaximumAutomaticRedirections = 4;
request.MaximumResponseHeadersLength = 4;
WebResponse response =
(WebResponse)request.GetResponse(); // crashes here
fromcache.Checked = response.IsFromCache;
long length = response.ContentLength;
string contentType = response.ContentType;
// Get the stream associated with the response.
Stream receiveStream = response.GetResponseStream();
// Pipes the stream to a higher level stream reader
with the required encoding format.
StreamReader readStream = new
StreamReader(receiveStream, Encoding.UTF8);
label2.Text = readStream.ReadToEnd();
response.Close();
readStream.Close();
textBox2.Text = "completed!";
}
catch (Exception ee)
{
textBox2.Text = ee.Message;
}
The server committed a protocol violation. Section=ResponseStatusLine
I am reading a CSV file from a deprag controller running linux.
My code on win7 is as follows:
textBox2.Text = "starting...";
try
{
HttpWebRequest request =
(HttpWebRequest)WebRequest.Create(textBox1.Text);
textBox1.Text = http://200.200.200.101/cgi-bin/cgiread?site=13&dlfile=/mnt/mmc/finaldata/Actual.csv
// Set some reasonable limits on resources used by
this request
request.ServicePoint.Expect100Continue = false;
request.MaximumAutomaticRedirections = 4;
request.MaximumResponseHeadersLength = 4;
WebResponse response =
(WebResponse)request.GetResponse(); // crashes here
fromcache.Checked = response.IsFromCache;
long length = response.ContentLength;
string contentType = response.ContentType;
// Get the stream associated with the response.
Stream receiveStream = response.GetResponseStream();
// Pipes the stream to a higher level stream reader
with the required encoding format.
StreamReader readStream = new
StreamReader(receiveStream, Encoding.UTF8);
label2.Text = readStream.ReadToEnd();
response.Close();
readStream.Close();
textBox2.Text = "completed!";
}
catch (Exception ee)
{
textBox2.Text = ee.Message;
}