HttpWebRequest HttpWReq = (HttpWebRequest)WebRequest.Create("http://www.contoso.com"); // Turn off connection keep-alives. HttpWReq.KeepAlive = false;HttpWebResponse HttpWResp = (HttpWebResponse)HttpWReq.GetResponse();// Get the HTTP protocol version number returned by the server. String ver = HttpWResp.ProtocolVersion.ToString(); HttpWResp.Close();
(HttpWebRequest)WebRequest.Create("http://www.contoso.com");
// Turn off connection keep-alives.
HttpWReq.KeepAlive = false;HttpWebResponse HttpWResp = (HttpWebResponse)HttpWReq.GetResponse();// Get the HTTP protocol version number returned by the server.
String ver = HttpWResp.ProtocolVersion.ToString();
HttpWResp.Close();