毕业论文英文文献及翻译文档格式.docx
《毕业论文英文文献及翻译文档格式.docx》由会员分享,可在线阅读,更多相关《毕业论文英文文献及翻译文档格式.docx(7页珍藏版)》请在冰豆网上搜索。
Finally,mostprogramminglanguageshavesimilarvariabledatatypes.Inmostlanguages,youhavesomemeansofrepresentingstringsandintegers,forexample.Themaximumandminimumsizeofanintegermightdependonthelanguage,butthebasicdatatypeisthesame.
Maintainingallthisfunctionalityformultiplelanguagesrequiresalotofwork.Whykeepreinventingthewheel?
Wouldn'
titbeeasiertocreateallthisfunctionalityonceanduseitforeverylanguage?
The.NETFrameworkClassLibrarydoesexactlythat.Itconsistsofavastsetofclassesdesignedtosatisfyanyconceivableprogrammingneed.Forexample,the.NETframeworkcontainsclassesforhandlingdatabaseaccess,workingwiththefilesystem,manipulatingtext,andgeneratinggraphics.Inaddition,itcontainsmorespecializedclassesforperformingtaskssuchasworkingwithregularexpressionsandhandlingnetworkprotocols.
The.NETframework,furthermore,containsclassesthatrepresentallthebasicvariabledatatypessuchasstrings,integers,bytes,characters,andarrays.
Mostimportantly,forpurposesofthisbook,the.NETFrameworkClassLibrarycontainsclassesforbuildingASP.NETpages.Youneedtounderstand,however,thatyoucanaccessanyofthe.NETframeworkclasseswhenyouarebuildingyourASP.NETpages.
UnderstandingNamespaces
Asyoumightguess,the.NETframeworkishuge.Itcontainsthousandsofclasses(over3,400).Fortunately,theclassesarenotsimplyjumbledtogether.Theclassesofthe.NETframeworkareorganizedintoahierarchyofnamespaces.
ASPClassicNote
InpreviousversionsofActiveServerPages,youhadaccesstoonlyfivestandardclasses(theResponse,Request,Session,Application,andServerobjects).ASP.NET,incontrast,providesyouwithaccesstoover3,400classes!
Anamespaceisalogicalgroupingofclasses.Forexample,alltheclassesthatrelatetoworkingwiththefilesystemaregatheredtogetherintotheSystem.IOnamespace.
Thenamespacesareorganizedintoahierarchy(alogicaltree).AttherootofthetreeistheSystemnamespace.Thisnamespacecontainsalltheclassesforthebasedatatypes,suchasstringsandarrays.Italsocontainsclassesforworkingwithrandomnumbersanddatesandtimes.
Youcanuniquelyidentifyanyclassinthe.NETframeworkbyusingthefullnamespaceoftheclass.Forexample,touniquelyrefertotheclassthatrepresentsafilesystemfile(theFileclass),youwouldusethefollowing:
System.IO.File
System.IOreferstothenamespace,andFilereferstotheparticularclass.
NOTE
Youcanviewallthenamespacesofthestandardclassesinthe.NETFrameworkClassLibrarybyviewingtheReferenceDocumentationforthe.NETFramework.
StandardASP.NETNamespaces
TheclassescontainedinaselectnumberofnamespacesareavailableinyourASP.NETpagesbydefault.(Youmustexplicitlyimportothernamespaces.)ThesedefaultnamespacescontainclassesthatyouusemostofteninyourASP.NETapplications:
System—Containsallthebasedatatypesandotherusefulclassessuchasthoserelatedtogeneratingrandomnumbersandworkingwithdatesandtimes.
System.Collections—Containsclassesforworkingwithstandardcollectiontypessuchashashtables,andarraylists.
System.Collections.Specialized—Containsclassesthatrepresentspecializedcollectionssuchaslinkedlistsandstringcollections.
System.Configuration—Containsclassesforworkingwithconfigurationfiles(Web.configfiles).
System.Text—Containsclassesforencoding,decoding,andmanipulatingthecontentsofstrings.
System.Text.RegularExpressions—Containsclassesforperformingregularexpressionmatchandreplaceoperations.
System.Web—ContainsthebasicclassesforworkingwiththeWorldWideWeb,includingclassesforrepresentingbrowserrequestsandserverresponses.
System.Web.Caching—Containsclassesusedforcachingthecontentofpagesandclassesforperformingcustomcachingoperations.
System.Web.Security—ContainsclassesforimplementingauthenticationandauthorizationsuchasFormsandPassportauthentication.
System.Web.SessionState—Containsclassesforimplementingsessionstate.
System.Web.UI—ContainsthebasicclassesusedinbuildingtheuserinterfaceofASP.NETpages.
System.Web.UI.HTMLControls—ContainstheclassesfortheHTMLcontrols.
System.Web.UI.WebControls—ContainstheclassesfortheWebcontrols.
.NETFramework-CompatibleLanguages
Forpurposesofthisbook,youwillwritetheapplicationlogicforyourASP.NETpagesusingVisualBasicasyourprogramminglanguage.ItisthedefaultlanguageforASP.NETpages(andthemostpopularprogramminglanguageintheworld).AlthoughyousticktoVisualBasicinthisbook,youalsoneedtounderstandthatyoucancreateASP.NETpagesbyusinganylanguagethatsupportsthe.NETCommonLanguageRuntime.Outofthebox,thisincludesC#(pronouncedSeeSharp),JScript.NET(the.NETversionofJavaScript),andtheManagedExtensionstoC++.
NOTE
TheCDincludedwiththisbookcontainsC#versionsofallthecodesamples.
DozensofotherlanguagescreatedbycompaniesotherthanMicrosofthavebeendevelopedtoworkwiththe.NETframework.SomeexamplesoftheseotherlanguagesincludePython,SmallTalk,Eiffel,andCOBOL.Thismeansthatyoucould,ifyoureallywantedto,writeASP.NETpagesusingCOBOL.
RegardlessofthelanguagethatyouusetodevelopyourASP.NETpages,youneedtounderstandthatASP.NETpagesarecompiledbeforetheyareexecuted.ThismeansthatASP.NETpagescanexecuteveryquickly.
ThefirsttimeyourequestanASP.NETpage,thepageiscompiledintoa.NETclass,andtheresultingclassfileissavedbeneathaspecialdirectoryonyourservernamedTemporaryASP.NETFiles.ForeachandeveryASP.NETpage,acorrespondingclassfileappearsintheTemporaryASP.NETFilesdirectory.WheneveryourequestthesameASP.NETpageinthefuture,thecorrespondingclassfileisexecuted.
WhenanASP.NETpageiscompiled,itisnotcompileddirectlyintomachinecode.Instead,itiscompiledintoanintermediate-levellanguagecalledMicrosoftIntermediateLanguage(MSIL).All.NET-compatiblelanguagesarecompiledintothisintermediatelanguage.
AnASP.NETpageisn'
tcompiledintonativemachinecodeuntilitisactuallyrequestedbyabrowser.Atthatpoint,theclassfilecontainedintheTemporaryASP.NETFilesdirectoryiscompiledwiththe.NETframeworkJustinTime(JIT)compilerandexecuted.
Themagicalaspectofthiswholeprocessisthatithappensautomaticallyinthebackground.AllyouhavetodoiscreateatextfilewiththesourcecodeforyourASP.NETpage,andthe.NETframeworkhandlesallthehardworkofconvertingitintocompiledcodeforyou.
ASPCLASSICNOTE
WhataboutVBScript?
BeforeASP.NET,VBScriptwasthemostpopularlanguagefordevelopingActiveServerPages.
ASP.NETdoesnotsupportVBScript,andthisisgoodnews.VisualBasicisasupersetofVBScript,whichmeansthatVisualBasichasallthefunctionalityofVBScriptandmore.So,youhavearichersetoffunctionsandstatementswithVisualBasic.
Furthermore,unlikeVBScript,VisualBasicisacompiledlanguage.ThismeansthatifyouuseVisualBasictorewritethesamecodethatyouwrotewithVBScript,youcangetbetterperformance.
IfyouhaveworkedonlywithVBScriptandnotVisualBasicinthepast,don'
tworry.SinceVBScriptissocloselyrelatedtoVisualBasic,you'
llfinditeasytomakethetransitionbetweenthetwolanguages.
NOTEMicrosoftincludesaninterestingtoolnamedtheILDisassembler(ILDASM)withthe.NETframework.YoucanusethistooltoviewthedisassembledcodeforanyoftheASP.NETclassesintheTemporaryASP.NETFilesdirectory.Itlistsallthemethodsandpropertiesoftheclassandenablesyoutoviewtheintermediate-levelcode.
ThistoolalsoworkswithalltheASP.NETcontrolsdiscussedinthischapter.Forexample,youcanusetheILDisassemblertoviewtheintermediate-levelcodefortheTextBoxcontrol(locatedinafilenamedSystem.Web.dll).
中文翻译
ASP.NET和.NETFramework
ASP.NET是微软.NET框架总体战略的一部分。
它包含了一组满足各种可以想象到的需求的类。
在之后的两个部分,你将会学到ASP.NET是怎样融合到.NET框架中去的,而且你将会学到可以在ASP.NET页面中使用到的语言。
.NET框架类库
假设你就是微软,假设你必须支持多语言编程,例如VB,JS,C++。
这些语言的很多函数都重复了,比如对于每种语言,你都必须包含一些访问文件系统,与数据库打交道,以及处理字符串的函数。
而且这些语言都包含了相似的变成结构。
每种语言都有循环和条件语句。
虽然条件语句的语法有些出入,但是功能还是一样的。
最后,很多变成语言都有相似的变量类型定义。
在很多语言中,你都可以表达出字符串类型和整型。
整型数的最大和最小值则由语言本身决定,但基本的表量类型还是相同的。
维护所有这些语言的函数会很费事。
干吗要不断的重复历史的车轮?
如果只对函数建立一次而后对每种语言都使用是否会更爽些?
而.net框架类库正是如此,它包含了一组为满足变成需要而设计的类。
举例来说,.net框架包含了处理数据库访问的一组类。
同时还有文件系统处理类以及视图产生类。
而且,他包含了更多的较为细化的用来处理正则表达式和网络协议的类。
更重要的是,.net框架还将所有一些基础变量都表示了出来,例如字符串类型,整型,字符型和数组。
最重要的也是本书的主要目的,.net框架类库包含了用来建立页面的类。
你需要明白的是,你可以在建立自己的页面的时候访问任