ASP NET入门C#版毕业论文外文文献翻译.docx
《ASP NET入门C#版毕业论文外文文献翻译.docx》由会员分享,可在线阅读,更多相关《ASP NET入门C#版毕业论文外文文献翻译.docx(16页珍藏版)》请在冰点文库上搜索。
D科技译文
…
…
…
… BeginningASP.NET2.0inC#
…
…
… ASP(ActiveServerPages)isarelativelynewtechnologythat’salready
…
…
… leaptthroughseveralstagesofevolution.Itwasintroducedaboutsevenyears
装
… agoasaneasywaytoadddynamiccontenttoordinarywebpages.Sincethen,
…
… it’sgrownintosomethingmuchmoreambitious:
aplatformforcreating
…
… advancedwebapplications,includingmerceshops,data.drivenportalsites,
…
… andjustaboutanythingelseyoucanfindontheInternet.ASP.NET2.0isthe
…
…
… latestversionofASP,anditrepresentsthemostdramaticchangeyet.With
…
… ASP.NET,developersnolongerneedtopastetogetherajumbleofHTMLand
…
… scriptcodeinordertoprogramtheWeb.Instead,youcancreatefull.scaleweb
…
订 applicationsusingnothingbutcodeandadesigntoolsuchasVisualStudio2008
…
…
… Thecostofallthisinnovationisthelearningcurve.Notonlydo youneedto
…
… learnhowtouseanadvanceddesigntool(VisualStudio)andatoolkitofobjects
…
… (the.NETFramework),youalsoneedtomasteraprogramminglanguagesuch
…
… asC#.TheInternetbeganinthelate1960sasanexperiment.Itsgoalwasto
…
… createatrulyresilientinformationnetwork—onethatcouldwithstandthelossof
…
线
… severalcomputerswithoutpreventingtheothersfromcommunicating.Driven
…
… bypotentialdisasterscenarios(suchasnuclearattack),theU.S.Departmentof
…
… Defenseprovidedtheinitialfunding.TheearlyInternetwasmostlylimitedto
…
… educationalinstitutionsanddefensecontractors.Itflourishedasatoolfor
…
…
… academic collaboration, allowing researchers across the globe to share
…
… information.Intheearly1990s,modemswerecreatedthatcouldworkoverexistingphonelines,andtheInternetbegantoopenuptocommercialusers.In
1993,thefirstHTMLbrowserwascreated,andtheInternetrevolutionbegan.It
… wouldbedifficulttodescribeearlywebsitesaswebapplications.Instead,the
…
…
… firstgenerationofwebsitesoftenlookedmorelikebrochures,consistingmostly
…
… offixedHTMLpagesthatneededtobeupdatedbyhand.BasicHTMLpageisa
…
… littlelikeaword.processingdocument—itcontainsformattedcontentthatcanbe
…
… displayedonyourcomputer,butitdoesn’tactuallydoanything.Thefollowing
…
装 exampleshowsHTMLatitssimplest,withadocumentthatcontainsaheading
…
…
… andsinglelineoftext:
AnHTMLdocumenthastwotypesofcontent:
thetext
…
… andthetagsthattellthebrowserhowtoformatit.Thetagsareeasily
…
… recognizable,becausetheyoccurinsideangledbrackets(<>).HTMLdefines
…
… tagsfordifferentlevelsofheadings,paragraphs,hyperlinks,italicandbold
…
…
… formatting,horizontallines,andsoon.Forexample,
SomeText
tells
…
… thebrowsertodisplaySomeTextintheHeading1style,whichusesalarge,
订
… boldfont.Figure1.1showsthesimpleHTMLpageinabrowser.HTML2.0
…
… introducedthefirstseedofwebprogrammingwithatechnologycalledHTML
…
…
… forms.HTMLformsexpandHTMLsothatitincludesnotonlyformattingtags
…
… butalsotagsforgraphicalwidgets,orcontrols.Thesecontrolsincludecommon
…
… ingredientssuchasdrop.downlists,textboxes,andbuttons.Here’sasample
…
… web pagecreated with HTMLformcontrols:
HTMLforms allow web
…
线 applicationdeveloperstodesignstandardinputpages.Whentheuserclicksthe
…
…
… SubmitbuttononthepageshowninFigure1.2,allthedataintheinputcontrols
…
… (inthiscase,thetwocheckboxes)ispatchedtogetherintoonelongstringand
…
… senttothewebserver.Ontheserverside,acustomapplicationreceivesand
…
… processesthedata.Amazinglyenough,thecontrolsthatwerecreatedforHTML
…
… formsmorethantenyearsagoarestillthebasicfoundationthat you’lluseto
builddynamicASP.NETpages!
Thedifferenceisthetypeofapplicationthat
… runsontheserverside.Inthepast, whentheuserclickedabuttononaform
…
…
… page,theinformationmighthavebeene.mailedtoasetaccountorsenttoan
…
… applicationontheserverthatusedthechallengingCGI(CommonGateway
…
… Interface)standard.Today,you’llworkwiththemuchmorecapableandelegant
…
… ASP.NETplatform.TounderstandwhyASP.NETwascreated,ithelpsto
…
装 understandtheproblemsofotherwebdevelopmenttechnologies.Withthe
…
…
… originalCGIstandard,forexample,thewebservermustlaunchacompletely
…
… separateinstanceoftheapplicationforeachwebrequest.Ifthewebsiteis
…
… popular,thewebservermuststruggleundertheweightofhundredsofseparate
…
… copiesoftheapplication,eventuallybecomingavictimofitsownsuccessor
…
…
… counterthisproblem,MicrosoftdevelopedISAPI(InternetServerApplication
…
… ProgrammingInterface),ahigher.levelprogrammingmodel.ISAPIsolvedthe
订
… performanceproblembutatthecostofsignificantcomplexity.EvenafterISAPI
…
… developersmasterthetrickyC++programminglanguage,theystilllieawakeat
…
…
… nightworryingaboutconfoundingissuessuchasmultithreading. ISAPI
…
… programmingisdefinitelynotforthefainthearted.SAPIneverreallywentaway.
…
… Instead,Microsoftusedittobuildhigher.leveldevelop.mintplatforms,suchas
…
… ASPandASP.NET.Bothofthesetechnologiesallowdeveloperstoprogram
…
线 dynamicwebpageswithoutworryingaboutthelow.levelimplementationdetails.
…
…
… Forthatreason,bothplatformshavebecomeincrediblysuccessful.Theoriginal
…
… ASPplatformgarneredahugeaudienceofnearlyonemilliondevelopers.When
…
… ASP.NETwasfirstreleased,itgeneratedevenmoreinterestasthecenterpieceof
…
… the.NETFrame.work.Infact,ASP.NET1.0wasenthusiasticallyputtoworkin
…
… dozensoflarge.scalecommercialwebsitesevenwhenitwasonlyinlatebeta.
Despitehavingsimilarunderpinnings,ASPandASP.NETareradicallydifferent.
… ASPis ascript.based programminglanguage that requiresa thorough
…
…
… understandingofHTMLandagooddealofpainfulcoding.ASP.NET,onthe
…
… otherhand,isanobject.orientedpro.gammingmodelthatletsyouputtogethera
…
… webpageaseasilyasyouwouldbuildaWindowsapplication.Inmanyrespects,
…
… it’seasiertolearnASP.NETthantomasterASP,eventhoughASP.NETisfar
…
装 morepowerful.Atthesametimethatserver.sidewebdevelopmentwasmoving
…
…
… throughanalphabetsoupoftechnologies,anewtypeofprogrammingwas
…
… gainingpopularity.Developersbegantoexperimentwiththedifferentwaysthey
…
… couldenhancewebpagesbyembed.dingmultimediaandminiatureappletsbuilt
…
… withJavaScript,DHTML(DynamicHTML),andJavacode.Theseclient.side
…
…
… technologiesdon’tinvolveanyserverprocessing. Instead,thecomplete
…
… applicationisdownloadedtotheclientbrowser,whichexecutesitlocally.The
订
… greatestproblemwithclient.sidetechnologiesisthattheyaren’tsupported
…
… equallybyallbrowsersandoperatingsystems.Oneofthereasonsthatweb
…
… developmentissopopularinthefirstplaceisbecausewebapplicationsdon’t
…
…
… requiresetupCDs,down.loads,andothertedious(anderror.prone)deployment
…
… steps.Instead,awebapplicationcanbeusedonanycomputerthathasInternet
…
… access.Butwhendevelopersuseclient.sidetechnologies,theyencounterafew
…
线 familiarheadaches.Suddenly,cross.browsercompatibilitybecomesaproblem.
…
…
… Developersareforcedtotesttheirwebsiteswithoperatingsystemsand
…
… browsers,andtheymightevenneedtodistributebrowserupdatestotheirclients.
…
… Inotherwords,theclient.sidemodelsacrificessomeofthemostimportant
…
… benefitsofwebdevelopment.orthatreason,ASP.NETisdesignedasa
…
… server.sidetechnology.AllASP.NETcodeexecutesontheserver.Whenthecode
isfinishedexecuting,theuserreceivesanordinaryHTMLpage,whichcanbe
… viewedinanybrowser.Figure1.3showsthedifferencebetweentheserver.side
…
…
… andclient.sidemodel.Thesearesomeotherreasonsforavoidingclient.side
…
… programming:
Isolation:
Client.sidecodecan’taccessserver.sideresources.For
…
… example,aclient.sideapplicationhasnoeasywaytoreadafileorinteractwith
…
… adatabaseontheserver(atleastnotwithoutrunningintoproblemswithsecurity
…
装 andbrowsercompatibility).Security:
Enduserscanviewclient.sidecode.And
…
…
… oncemalicioususersunderstandhowanapplicationworks,theycanoften
…
… tamperwithit.mecases,ASP.NETallowsyoutocombinethebestofclient.side
…
… programmingwithserver.sideprogramming.Forexample,thebestASP.NET
…
… controlscanintelligentlydetectthefeaturesoftheclientbrowser.Ifthebrowser
…
…
… supportsJavaScript,thesecontrolswillreturnawebpagethatincorporates
…
… JavaScriptforaricher,moreresponsiveuserinterface.However,nomatterwhat
订
… thecapabilitiesofthebrowser,yourcodeisalwaysexecutedontheserver.State
…
… limitations:
Toensureoptimumperformance,theWebisbuiltonstateless
…
…
… protocols,whichmeansassoonasapageissenttoauser,theconnectionis
…
… closedandanyuser.specificinformationisdiscarded.ASPincludesasession
…
… statefeaturethatallowsprogrammerstoworkaroundthisproblem.Using
…
… sessionstate,awebapplicationcanretaintemporary