看起来是一个古老的东西,我搜索MSDN,在2001年的MSDN Magazine的代码示例中看到了这个类,代码如下: // Create a WebRequest object passing in the desired URI to the .Create() // method and then // get a response from the server by calling .GetResponse(); WebRequest WReq = WebRequestFactory.Create("http://www.mypeer-to- peer.com/news.htm"); WebResponse WResp = WReq.GetResponse();应该就是现在的WebRequest,看起来是beta版本的产物,后来MS将这两个东西统一了吧。现在的用法: // Create a new 'Uri' object with the specified string. Uri myUri =new Uri("http://www.contoso.com"); // Create a new request to the above mentioned URL. WebRequest myWebRequest= WebRequest.Create(myUri); // Assign the response object of 'WebRequest' to a 'WebResponse' variable. WebResponse myWebResponse= myWebRequest.GetResponse();
// Create a WebRequest object passing in the desired URI to the .Create()
// method and then
// get a response from the server by calling .GetResponse();
WebRequest WReq = WebRequestFactory.Create("http://www.mypeer-to-
peer.com/news.htm");
WebResponse WResp = WReq.GetResponse();应该就是现在的WebRequest,看起来是beta版本的产物,后来MS将这两个东西统一了吧。现在的用法:
// Create a new 'Uri' object with the specified string.
Uri myUri =new Uri("http://www.contoso.com");
// Create a new request to the above mentioned URL.
WebRequest myWebRequest= WebRequest.Create(myUri);
// Assign the response object of 'WebRequest' to a 'WebResponse' variable.
WebResponse myWebResponse= myWebRequest.GetResponse();