Htt的prequest,HttpWebRequest和WebRequest的区别 [英] Difference between HttpRequest, HttpWebRequest and WebRequest
问题描述
我不知道是否有人解释为上市类的区别
I was wondering if somebody explain the difference for the listed classes
推荐答案
他们做不同的事情。
<一个href=\"http://msdn.microsoft.com/en-us/library/system.net.webrequest.aspx\"><$c$c>WebRequest$c$c>是的HttpWebRequest
抽象基类 - 你不能直接使用它。这是基类中的其他 *请求
类(对于FTP,文件和其他类型的Web请求的)。这些类都是用来从网络上获得的资源(文件)。
WebRequest
is the abstract base class for HttpWebRequest
- you can't use it directly. It is the base class of other *Request
classes (for FTP, File and other types of web requests). These classes are all used for getting resources (files) from the web.
还有一个 Web客户端
类 - 可能是使用最简单的设计,从互联网上的资源全部BCL类
There is also a WebClient
class - probably the simplest to use of all the BCL classes designed to retrieve a resource from the Internet.
<一个href=\"http://msdn.microsoft.com/en-us/library/system.web.htt$p$pquest.aspx\"><$c$c>Htt$p$pquest$c$c>,在另一方面重新presents在ASP.NET应用程序中的资源的请求 - 这是服务器端的一个请求
的。
的主要区别是,的HttpWebRequest
是一个HTTP的客户和的Htt prequest
是服务器的将在ASP.NET Web应用程序使用的一面。
The main difference is that HttpWebRequest
is an HTTP client, and HttpRequest
is server side to be used in an ASP.NET web application.
这篇关于Htt的prequest,HttpWebRequest和WebRequest的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!