英文文献与翻译Word格式.docx
- 文档编号:17132928
- 上传时间:2022-11-28
- 格式:DOCX
- 页数:14
- 大小:27.48KB
英文文献与翻译Word格式.docx
《英文文献与翻译Word格式.docx》由会员分享,可在线阅读,更多相关《英文文献与翻译Word格式.docx(14页珍藏版)》请在冰豆网上搜索。
The.NETFrameworkClassLibrary
ImaginethatyouareMicrosoft.Imaginethatyouhavetosupportmultipleprogramminglanguages—suchasVisualBasic,JScript,andC++.Agreatdealofthefunctionalityoftheseprogramminglanguagesoverlaps.Forexample,foreachlanguage,youwouldhavetoincludemethodsforaccessingthefilesystem,workingwithdatabases,andmanipulatingstrings.
Furthermore,theselanguagescontainsimilarprogrammingconstructs.Everylanguage,forexample,canrepresentloopsandconditionals.EventhoughthesyntaxofaconditionalwritteninVisualBasicdiffersfromthesyntaxofaconditionalwritteninC++,theprogrammingfunctionisthesame.
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.AlthoughyousticktoVisualBasicinthisbook,youalsoneedtounderstandthatyoucancreateASP.NETpagesbyusinganylanguagethatsupportsthe.NETCommonLanguageRuntime.Outofthebox,thisincludesC#,JScript.NET,andtheManagedExtensionstoC++.
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.
MicrosoftincludesaninterestingtoolnamedtheILDisassembler(ILDASM)withthe.NETframework.YoucanusethistooltoviewthedisassembledcodeforanyoftheASP.NETclassesintheTemporaryASP.NETFilesdirectory.Itlistsallthemethodsandpropertiesoftheclassandenablesyoutoviewtheintermediate-levelcode.
ThistoolalsoworkswithalltheASP.NETcontrolsdiscussedinthischapter.Forexample,youcanusetheILDisassemblertoviewtheintermediate-levelcodefortheTextBoxcontrol(locatedinafilenamedSystem.Web.dll).
IntroducingASP.NETControls
ASP.NETcontrolsprovidethedynamicandinteractiveportionsoftheuserinterfaceforyourWebapplication.ThecontrolsrenderthecontentthattheusersofyourWebsiteactuallyseeandinteractwith.Forexample,youcanusecontrolstocreateHTMLformelements,interactivecalendars,androtatingbanneradvertisements.
ASP.NETcontrolscoexistpeacefullywithHTMLcontent.Typically,youcreatethestaticareasofyourWebpageswithnormalHTMLcontentandcreatethedynamicorinteractiveportionswithASP.NETcontrols.
ThebestwaytounderstandhowASP.NETcontrolsworkinanHTMLpageistolookatasimpleWebFormsPage.
AddingApplicationLogictoanASP.NETPage
ThesecondbuildingblockofanASP.NETpageistheapplicationlogic,whic
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 英文 文献 翻译