System.Net与System.Web.有什么区别? [英] System.Net vs. System.Web. What is the difference?

查看:70
本文介绍了System.Net与System.Web.有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到的一件事,但是直到现在还没有正式问过:System.Net命名空间和System.Web命名空间之间的区别是什么?为什么它们都存在?它们似乎具有相同类/概念的不同实现(例如,Cookie,Mail,HttpWebRequest).它们是否设计用于稍微不同的目的?还是旧式命名空间?

One of the things I've noticed, but have never formally asked until now: What is the difference between the classes in the System.Net namespace and the System.Web namespace? Why do they both exist? They seem to have different implementations of the same classes/concepts (Cookie, Mail, HttpWebRequest, for example). Are they designed to be used for slightly different purposes? Or is one a legacy namespace?

推荐答案

它遵循客户端和服务器应用之间的自然隔离.System.Web(几乎)由实施服务器的.NET应用专门使用.就像ASP.NET应用程序一样.值得注意的是,它在客户端框架配置文件中丢失.System.Net包含对客户端应用有用的类.

It follows the natural segregation between client and server apps. System.Web is (almost) exclusively used by .NET apps that implement a server. Like an ASP.NET app. It is notable for being missing in the Client framework profile. System.Net contains classes useful to a client app.

这篇关于System.Net与System.Web.有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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