Htt的prequest,HttpWebRequest和WebRequest的区别 [英] Difference between HttpRequest, HttpWebRequest and WebRequest

查看:132
本文介绍了Htt的prequest,HttpWebRequest和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的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,在另一方面重新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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆