外文翻译ASPNET C#版Word文件下载.docx

上传人:b****5 文档编号:21104980 上传时间:2023-01-27 格式:DOCX 页数:6 大小:25.21KB
下载 相关 举报
外文翻译ASPNET C#版Word文件下载.docx_第1页
第1页 / 共6页
外文翻译ASPNET C#版Word文件下载.docx_第2页
第2页 / 共6页
外文翻译ASPNET C#版Word文件下载.docx_第3页
第3页 / 共6页
外文翻译ASPNET C#版Word文件下载.docx_第4页
第4页 / 共6页
外文翻译ASPNET C#版Word文件下载.docx_第5页
第5页 / 共6页
点击查看更多>>
下载资源
资源描述

外文翻译ASPNET C#版Word文件下载.docx

《外文翻译ASPNET C#版Word文件下载.docx》由会员分享,可在线阅读,更多相关《外文翻译ASPNET C#版Word文件下载.docx(6页珍藏版)》请在冰豆网上搜索。

外文翻译ASPNET C#版Word文件下载.docx

ASP.NET2.0inC#

ASP(ActiveServerPages)isarelativelynewtechnologythat’salreadyleaptthroughseveralstagesofevolution.Itwasintroducedaboutsevenyearsagoasaneasywaytoadddynamiccontenttoordinarywebpages.Sincethen,it’sgrownintosomethingmuchmoreambitious:

aplatformforcreatingadvancedwebapplications,includinge-commerceshops,data-drivenportalsites,andjustaboutanythingelseyoucanfindontheInternet.ASP.NET2.0isthelatestversionofASP,anditrepresentsthemostdramaticchangeyet.WithASP.NET,developersnolongerneedtopastetogetherajumbleofHTMLandscriptcodeinordertoprogramtheWeb.Instead,youcancreatefull-scalewebapplicationsusingnothingbutcodeandadesigntoolsuchasVisualStudio2005.Thecostofallthisinnovationisthelearningcurve.Notonlydoyouneedtolearnhowtouseanadvanceddesigntool(VisualStudio)andatoolkitofobjects(the.NETFramework),youalsoneedtomasteraprogramminglanguagesuchasC#.TheInternetbeganinthelate1960sasanexperiment.Itsgoalwastocreateatrulyresilientinformationnetwork—onethatcouldwithstandthelossofseveralcomputerswithoutpreventingtheothersfromcommunicating.Drivenbypotentialdisasterscenarios(suchasnuclearattack),theU.S.DepartmentofDefenseprovidedtheinitialfunding.TheearlyInternetwasmostlylimitedtoeducationalinstitutionsanddefensecontractors.Itflourishedasatoolforacademiccollaboration,allowingresearchersacrosstheglobetoshareinformation.Intheearly1990s,modemswerecreatedthatcouldworkoverexistingphonelines,andtheInternetbegantoopenuptocommercialusers.In1993,thefirstHTMLbrowserwascreated,andtheInternetrevolutionbegan..Itwouldbedifficulttodescribeearlywebsitesaswebapplications.Instead,thefirstgenerationofwebsitesoftenlookedmorelikebrochures,consistingmostlyoffixedHTMLpagesthatneededtobeupdatedbyhandbasicHTMLpageisalittlelikeaword-processingdocument—itcontainsformattedcontentthatcanbedisplayedonyourcomputer,butitdoesn’tactuallydoanything.ThefollowingexampleshowsHTMLatitssimplest,withadocumentthatcontainsaheadingandsinglelineoftext:

AnHTMLdocumenthastwotypesofcontent:

thetextandthetagsthattellthebrowserhowtoformatit.Thetagsareeasilyrecognizable,becausetheyoccurinsideangledbrackets(<

>

).HTMLdefinestagsfordifferentlevelsofheadings,paragraphs,hyperlinks,italicandboldformatting,horizontallines,andsoon.Forexample,<

h1>

SomeText<

/h1>

tellsthebrowsertodisplaySomeTextintheHeading1style,whichusesalarge,boldfont.Figure1-1showsthesimpleHTMLpageinabrowser.HTML2.0introducedthefirstseedofwebprogrammingwithatechnologycalledHTMLforms.HTMLformsexpandHTMLsothatitincludesnotonlyformattingtagsbutalsotagsforgraphicalwidgets,orcontrols.Thesecontrolsincludecommoningredientssuchasdrop-downlists,textboxes,andbuttons.Here’sasamplewebpagecreatedwithHTMLformcontrols:

HTMLformsallowwebapplicationdeveloperstodesignstandardinputpages.WhentheuserclickstheSubmitbuttononthepageshowninFigure1-2,allthedataintheinputcontrols(inthiscase,thetwocheckboxes)ispatchedtogetherintoonelongstringandsenttothewebserver.Ontheserverside,acustomapplicationreceivesandprocessesthedata.Amazinglyenough,thecontrolsthatwerecreatedforHTMLformsmorethantenyearsagoarestillthebasicfoundationthatyou’llusetobuilddynamicASP.NETpages!

Thedifferenceisthetypeofapplicationthatrunsontheserverside.Inthepast,whentheuserclickedabuttononaformpage,theinformationmighthavebeene-mailedtoasetaccountorsenttoanapplicationontheserverthatusedthechallengingCGI(CommonGatewayInterface)standard.Today,you’llworkwiththemuchmorecapableandelegantASP.NETplatform.TounderstandwhyASP.NETwascreated,ithelpstounderstandtheproblemsofotherwebdevelopmenttechnologies.WiththeoriginalCGIstandard,forexample,thewebservermustlaunchacompletelyseparateinstanceoftheapplicationforeachwebrequest.Ifthewebsiteispopular,thewebservermuststruggleundertheweightofhundredsofseparatecopiesoftheapplication,eventuallybecomingavictimofitsownsuccess.counterthisproblem,MicrosoftdevelopedISAPI(InternetServerApplicationProgrammingInterface),ahigher-levelprogrammingmodel.ISAPIsolvedtheperformanceproblembutatthecostofsignificantcomplexity.EvenafterISAPIdevelopersmasterthetrickyC++programminglanguage,theystilllieawakeatnightworryingaboutconfoundingissuessuchasmultithreading.ISAPIprogrammingisdefinitelynotforthefainthearted.ISAPIneverreallygoaway.Instead,Microsoftusedittobuildhigher-leveldevelopmentplatforms,suchasASPandASP.NET.Bothofthesetechnologiesallowdeveloperstoprogramdynamicwebpageswithoutworryingaboutthelow-levelimplementationdetails.Forthatreason,bothplatformshavebecomeincrediblysuccessful.TheoriginalASPplatformgarneredahugeaudienceofnearlyonemilliondevelopers.WhenASP.NETwasfirstreleased,itgeneratedevenmoreinterestasthecenterpieceofthe.NETFrame-work.Infact,ASP.NET1.0wasenthusiasticallyputtoworkindozensoflarge-scalecommercialwebsitesevenwhenitwasonlyinlatebeta.Despitehavingsimilarunderpinnings,ASPandASP.NETareradicallydifferent.ASPisascript-basedprogramminglanguagethatrequiresathoroughunderstandingofHTMLandagooddealofpainfulcoding.ASP.NET,ontheotherhand,isanobject-orientedprogrammingmodelthatletsyouputtogetherawebpageaseasilyasyouwouldbuildaWindowsapplication.Inmanyrespects,it’seasiertolearnASP.NETthantomasterASP,eventhoughASP.NETisfarmorepowerful.Atthesametimethatserver-sidewebdevelopmentwasmovingthroughanalphabetsoupoftechnologies,anewtypeofprogrammingwasgainingpopularity.Developersbegantoexperimentwiththedifferentwaystheycouldenhancewebpagesbyembed-dingmultimediaandminiatureappletsbuiltwithJavaScript,DHTML(DynamicHTML),andJavacode.Theseclient-sidetechnologiesdon’tinvolveanyserverprocessing.Instead,thecompleteapplicationisdownloadedtotheclientbrowser,whichexecutesitlocally.Thegreatestproblemwithclient-sidetechnologiesisthattheyaren’tsupportedequallybyallbrowsersandoperatingsystems.Oneofthereasonsthatwebdevelopmentissopopularinthefirstplaceisbecausewebapplicationsdon’trequiresetupCDs,down-loads,andothertedious(anderror-prone)deploymentsteps.Instead,awebapplicationcanbeusedonanycomputerthathasInternetaccess.Butwhendevelopersuseclient-sidetechnologies,theyencounterafewfamiliarheadaches.Suddenly,cross-browsercompatibilitybecomesaproblem.Developersareforcedtotesttheirwebsiteswithdifferentoperatingsystemsandbrowsers,andtheymightevenneedtodistributebrowserupdatestotheirclients.Inotherwords,theclient-sidemodelsacrificessomeofthemostimportantbenefitsofwebdevelopmentorthatreason,ASP.NETisdesignedasaserver-sidetechnology.AllASP.NETcodeexecutesontheserver.Whenthecodeisfinishedexecuting,theuserreceivesanordinaryHTMLpage,whichcanbeviewedinanybrowser.Figure1-3showsthedifferencebetweentheserver-sideandclient-sidemodel.Thesearesomeotherreasonsforavoidingclient-sideprogramming:

Isolation:

Client-sidecodecan’taccessserver-sideresources.Forexample,aclient-sideapplicationhasnoeasywaytoreadafileorinteractwithadatabaseontheserver(atleastnotwithoutrunningintoproblemswithsecurityandbrowsercompatibility).Security:

Enduserscanviewclient-sidecode.Andoncemalicioususersunderstandhowanapplicationworks,theycanoftentamperwithit.omecases,ASP.NETallowsyoutocombinethebestofclient-sideprogrammingwithserver-sideprogramming.Forexample,thebestASP.NETcontrolscanintelligentlydetectthefeaturesoftheclientbrowser.IfthebrowsersupportsJavaScript,thesecontrolswillreturnawebpagethatincorporatesJavaScriptforaricher,moreresponsiveuserinterface.However,nomatterwhatthecapabilitiesofthebrowser,yourcodeisalwaysexecutedontheserver.Statelimitations:

Toensureoptimumperformance,theWebisbuiltonstatelessprotocols,whichmeansassoonasapageissenttoauser,theconnectionisclosedandanyuser-specificinformationisdiscarded.ASPincludesasessionstatefeaturethatallowsprogrammerstoworkaroundthisproblem.Usingsessionstate,awebapplicationcanretaintemporaryinformationabouteachclientinservermemory.However,sessionstateisuselessinscenarioswhereawebsiteishostedbyseveralseparatewebservers.Inthisscenario,aclientmightaccessserverBwhileitssessioninformationistrappedonserverAandessentiallyabandoned.ASP.NETcorrectsthisproblembyallowingstatetobestoredinacentralrepository,suchasaseparateprocessoradatabasethatallserverscanaccess.ASP.NETdealswiththeseproblems(andmanymore)byintroducingacompletelynewmodelforwebpages.ThismodelisbasedonaremarkablepieceoftechnologycalledtheNETFramework.Youshouldunderstandthatthe.NETFrameworkisreallyaclusterofseveraltechnologies:

The.NETlanguages:

TheseincludeC#andVB.NET(VisualBasic.NET),theobject-orientedandmodernizedsuccessortoVisualBasic6.0;

theselanguagesalsoincludeJscript.NET(aserver-sideversionofJavaScript),J#(aJavaclone),andC++withManagedExtensionsheCLR(CommonLanguageRuntime):

Th

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 高等教育 > 工学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1