ASP.NET是由Microsoft推出的一种用来构建Web应用程序(Web Application)的强大技术。为了学习ASP.NET,我们首先要了解什么是Web应用程序。这就得从Internet应用说起。
1.1 Internet应用
但凡Internet应用,离不开服务器(Server)。用户(User)可以使用PC(Personal Computer)或PDA(Personal Digital Assistant,个人数字助理),连接到Internet并使用运行在Internet上的应用程序。如图1所示:
<shapetype id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"><stroke joinstyle="miter"></stroke><formulas><f eqn="if lineDrawn pixelLineWidth 0"></f><f eqn="sum @0 1 0"></f><f eqn="sum 0 0 @1"></f><f eqn="prod @2 1 2"></f><f eqn="prod @3 21600 pixelWidth"></f><f eqn="prod @3 21600 pixelHeight"></f><f eqn="sum @0 0 1"></f><f eqn="prod @6 1 2"></f><f eqn="prod @7 21600 pixelWidth"></f><f eqn="sum @8 21600 0"></f><f eqn="prod @7 21600 pixelHeight"></f><f eqn="sum @10 21600 0"></f></formulas><path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"></path><lock v:ext="edit" aspectratio="t"></lock></shapetype><shape id="_x0000_i1025" style="WIDTH: 414.75pt; HEIGHT: 181.5pt" type="#_x0000_t75" o:ole=""><imagedata src="file:///C:/DOCUME~1/STANLE~1/LOCALS~1/Temp/msohtml1/06/clip_image001.emz" o:title=""></imagedata></shape>
图1-1 Internet应用
1.2 Web不等同于Internet
只要是在Internet上运行的应用程序就能称作Web应用程序么?我们先来看这样两类Internet应用:
网站(Web Site)
平日里上网看八卦,去论坛里灌水,在自己的Blog里发牢骚,这些都是在网站上进行。
网络游戏
魔兽世界,又或者是EVE,玩得不亦乐乎。
网站和网络游戏的共同点在于:都需要连接到Internet上的服务器才能使用,所以二者都是Internet应用。但是它们之间还是有所不同:网站的特点是我们要打开浏览器(Browser),如Microsoft Internet Explorer(IE)和Mozilla Firefox,在浏览器中访问各式各样的网站。而网络游戏的特点是我们要在本地安装特定的客户端软件,如果要玩魔兽世界,就一定要安装魔兽世界的客户端。这样一来,我们只需要一个浏览器,就可以逛遍世界上所有网站,而如果只有魔兽世界的客户端,就只能玩魔兽世界这一款游戏。
我们看到,网站以页面(Page)的形式显示信息,提供服务,并且需要呈现在浏览器中供用户浏览。网站就是一种Web应用程序。至此,我们可以得到结论:Web不等同于Internet,Web应用是Internet应用中的一种。
1.3 B/S还是C/S
Web应用程序需要使用浏览器,因此又把它称为浏览器/服务器(Browser/Server)结构,即B/S结构;另一方面,网络游戏使用特定的客户端软件,因此把它称为客户端/服务器(Client/Server)结构,即C/S结构。
在Internet应用中,B/S和C/S结构各有各的优势和劣势,因此目前的Internet应用这两种结构都有用武之地,彼此互相补充。比如我们没有办法通过浏览器来玩大型的3D网络游戏,这是因为浏览器的表现力太弱。而单独安装的客户端软件,可以访问到计算机底层资源,比如显卡的驱动程序,因此在这类应用中C/S结构更胜一筹。一些企业应用,如MIS(Management Information System,管理信息系统)、OA(Office Automation,办公自动化)、ERP(Enterprise Resource Planning,企业资源计划)和CRM(Customer Relationship Management,客户关系管理)等,当初是使用VB或Delphi构建Windows窗体程序,随着B/S结构应用程序的发展,这类企业应用慢慢的被Web应用取代。很重要的一点就是因为B/S结构应用程序在部署上比C/S要容易。C/S结构应用程序需要在服务器和客户端都进行部署(想想魔兽世界的玩家数量),而B/S结构应用程序只需在服务器上部署。B/S和C/S的主要特点归纳为下表:
| B/S | C/S |
表现(Presentation) | × | √ |
部署(Deployment) | √ | × |
表1-1
目前有些Web技术打算增强浏览器中的表现力,如Macromedia主推的RIA(Rich Internet Application,富Internet应用),其中的主要技术是Flash(在浏览器中运行)和Flex(在服务器上运行)。另外还有AJAX(Asynchronous JavaScript and XML,异步JavaScript和XML)技术也是用来改善用户体验。
重申一下:B/S和C/S相比,并没有孰优孰劣之分,B/S还是C/S,完全考虑应用的场合。比如早期的Google Earth使用的是B/S结构,但是为了满足更高的视觉需求,又改成了C/S结构。
有迹象表明,Microsoft企图消除B/S结构和C/S结构之间的差异。一个应用程序,既是桌面(Desktop)的,又是Internet的。Microsoft迟迟不肯更新它的IE(迫于Firefox的压力才推出了一款改进不大的IE7)就是其中的一个表现——既然不区分B/S和C/S了,干脆也消灭掉浏览器的概念。这种变化将在新的Windows Vista以及后续本版的操作系统中发生。让我们拭目以待。
// to be continued
<iframe align="center" marginwidth="0" marginheight="0" src="http://www.zealware.com/csdnblog.html" frameborder="0" width="728" scrolling="no" height="90"></iframe>
分享到:
相关推荐
With this book, you will learn how to create engaging and interactive web applications using the latest version of the world's most popular web development platform: ASP.NET with AJAX, built on the ...
With this book, you will learn how to create engaging and interactive web applications using the latest version of the world's most popular web development platform: ASP.NET with AJAX, built on the ...
Pro ASP.NET 3.5 in C# 2008 raises the bar for high–quality, practical advice on learning and deploying Microsoft’s dynamic web solution. This new edition is updated with everything you need to ...
Pro ASP.NET 3.5 in C# 2008 raises the bar for high–quality, practical advice on learning and deploying Microsoft’s dynamic web solution. Seasoned .NET professionals Matthew MacDonald and Mario ...
Pro ASP.NET 4 in C# 2010 raises the bar for high-quality, practical advice on learning and deploying Microsoft's dynamic web solution. This new edition is updated with everything you need to master ...
Pro ASP.NET 3.5 in C# 2008 raises the bar for high–quality, practical advice on learning and deploying Microsoft’s dynamic web solution. Seasoned .NET professionals Matthew MacDonald and Mario ...
ASP.NET Core: Cloud-ready, Enterprise Web Application Development by Mugilan T. S. Ragupathi English | 9 Jun. 2017 | ASIN: B072KDVHCS | 1414 Pages | AZW3 | 36.34 MB Create fast, scalable, and high-...
Pro ASP.NET 4 in C# 2010 raises the bar for high-quality, practical advice on learning and deploying Microsoft's dynamic web solution. This new edition is updated with everything you need to master ...
And Sams Teach Yourself ASP.NET 2.0 in 24 Hours, Complete Starter Kit is the perfect learning tool. The Starter Kit provides the unbeatable combination of programmer/author Scott Mitchell and the ...
And Sams Teach Yourself ASP.NET 2.0 in 24 Hours, Complete Starter Kit is the perfect learning tool. The Starter Kit provides the unbeatable combination of programmer/author Scott Mitchell and the ...
ASP.NET 3.5 is the latest version of Microsoft’s ... Pro ASP.NET 3.5 in C# 2008 raises the bar for high–quality, practical advice on learning and deploying Microsoft’s dynamic web solution.
ASP.NET 3.5 is the latest version of Microsoft’s ... Pro ASP.NET 3.5 in C# 2008 raises the bar for high–quality, practical advice on learning and deploying Microsoft’s dynamic web solution.
ASP.NET 3.5 is the latest version of Microsoft’s ... Pro ASP.NET 3.5 in C# 2008 raises the bar for high–quality, practical advice on learning and deploying Microsoft’s dynamic web solution.
ASP.NET 3.5 is the latest version of Microsoft’s ... Pro ASP.NET 3.5 in C# 2008 raises the bar for high–quality, practical advice on learning and deploying Microsoft’s dynamic web solution.
This book explores ASP.NET, which is a core part of Microsoft’s .NET Framework. The .NET Framework is not a single application—it’s actually a collection of technologies bundled into one marketing ...
Pro ASP.NET 3.5 in C# 2008 raises the bar for high–quality, practical advice on learning and deploying Microsoft’s dynamic web solution. This new edition is updated with everything you need to ...
C# 7.1 and .NET Core 2.0 – Modern Cross-Platform Development – Third Edition 版本: Create powerful applications with .NET Standard 2.0, ASP.NET Core 2.0, … Visual Studio 2017 or Visual Studio Code ...
Pro ASP.NET 3.5 in C# 2008 raises the bar for high–quality, practical advice on learning and deploying Microsoft’s dynamic web solution. This new edition is updated with everything you need to ...
Pro ASP.NET 3.5 in C# 2008 raises the bar for high–quality, practical advice on learning and deploying Microsoft’s dynamic web solution. This new edition is updated with everything you need to ...
28 Adding Interactivity to Your Web Apps with ASP.NET AJAX 648 What Is AJAX? 648 Setting Up an ASP.NET AJAX Site 649 The AJAX Page Life Cycle 650 Loading Custom Script Libraries 652 ASP.NET...