毕业设计英文资料翻译文档格式.docx
- 文档编号:22778019
- 上传时间:2023-02-05
- 格式:DOCX
- 页数:12
- 大小:41.24KB
毕业设计英文资料翻译文档格式.docx
《毕业设计英文资料翻译文档格式.docx》由会员分享,可在线阅读,更多相关《毕业设计英文资料翻译文档格式.docx(12页珍藏版)》请在冰豆网上搜索。
however,VBScriptisbyfarthemostpopularchoice.Inthisarticle,I'
llbringyouuptospeedonthebasicsyntaxoftheVBScriptlanguage,includingvariables,operators,andcontrolstructures.
ThisarticleisthesecondinaseriesteachingASP.Specifically,thegoalofthisseriesistoteachyouallyouneedtoknowtocreatedynamicWebsitesusingASP.Thisarticlepicksuprightwherethepreviousarticleintheseries,GettingStartedwithASP,leftoff.
Variables
HereisthelistingforthefirstASPscriptIhelpedyoucreateinthepreviousarticle:
1<
html>
2<
head>
3<
title>
MyFirstASPPage<
/title>
4<
/head>
5<
body>
6<
%
7'
WriteoutasimpleHTMLparagraph
8Response.Write"
<
p>
ThisisatestofASP.<
/p>
"
9%>
10<
/body>
11<
/html>
AsIadmittedinthatarticle,thisisaprettyuninterestingexampleofanASPscript.Whenitcomesrightdowntoit,thisscriptdoesn'
tdoanythingaplain,oldHTMLpagecouldn'
tdo.Ohsure,Igaveaslightlymoreinterestingexamplethatdisplayedthecurrentservertime,buttobereallyusefulascriptneedstoperformsomeformofcalculation,ormanipulatedynamicinformationtopresentitinsomeinterestingway.
ThelanguageusedforwritingmostASPprograms,andwhichI'
llbeusingthroughoutthisseries,iscalledVBScript.Likemostprogramminglanguages,VBScriptletsyoustoredatainvariables.Avariablemaybethoughtofsimplyasanamedlocationinmemorywheredatamaybestored.VBScriptiswhatisknownasalooselytypedlanguage,whichmeansthataparticularvariablemaystoreanykindofinformation,beitanumber,apieceoftext,adate,orsomemorecomplicatedchunkofdata(asopposedtostrictlytypedlanguageswhereyoucanonlystoreonekindofinformationineachvariable).Beforeyoucanuseavariable,though,youmustdeclareit;
thatis,youmustletASPknowthatyouwanttocreateavariablewithaparticularname.
Let'
slookatabasicexampletohelpsolidifytheseconceptsinyourmind.SayyouwerewritingaWebpagethatperformedconversionsbetweenCelsiusandFahrenheittemperatures.IncountrieswhereCelsiusisused,20&
deg;
Ciscommonlyacceptedasthevalueforroomtemperature.ThefollowingcodecreatesavariablecalledintRoomTempC,andthenassignsitavalueof20:
NewRevised2ndEditionOutNOW!
BuildYourOwnDatabaseDrivenWebsiteUsingPHP&
MySQL"
FullyupdatedforPHP4.3.
InstallationinstructionsforMacOSX
Fullindexprovided
Newwiderbooksize
Enhancedfonts
Newcoverdesign
Lay-flatspine
Allcontentrevisited
DownloadtheFirst4ChaptersFREE
Tellmemoreaboutthistop-sellingbook.
DimintRoomTempC'
Createavariable
intRoomTempC=20'
Assignthevariableavalueof20
ThekeywordDimintheaboveisshortfordimension,andisusedtotellVBScripttocreateavariablewiththenamespecified(inthiscase,intRoomTempC).Why'
dimension'
youask?
Iagree,it'
snotthemostobviouschoice,butbasicallyitreferstowhatyou'
reaskingVBScripttodo.Whencreatingavariable,VBScriptneedstoassignsomespaceinmemorytostorewhatevervalue(s)willbeplacedinthevariable,andpartofthattaskistofigureoutthesize(dimension)ofthespacethatneedstobeallocated.Inanycase,creatingavariableisassimpleastypingDimfollowedbythenameofthevariable.
Thesecondlineoftheaboveexampleassignsavaluetothevariablethatwasjustcreated;
specifically,itstoresthenumber20inthevariable.Theequalssign(=)iscalledtheassignmentoperatorbecauseitisusedtoassignvaluestovariables.Duringthecourseofthisarticle,you'
llmeetmanyotheroperatorsthatdootherweirdandwonderfulthingstovariablesandthevaluestheystore.
Youshouldalwayscreateavariablebeforeassigningitavalue,andyou'
llusuallywanttoassignthevariableavaluebeforeputtingittouse.Tryingtoassignavaluetoavariablethatdoesnotexist,however,willcauseVBScripttoautomaticallycreateanewvariablewiththegivenname.Thisiscalledimplicitdeclaration,becauseanewvariableisdeclaredimplicitlyasaresultofyourtryingtoassignavaluetoavariablethatdoesn'
texist.Sinceyouarefreetouseimplicitdeclarationforallofyourvariables,youmaybewonderingwhatthepointisofusingtheDimcommandtocreateeachandeveryvariablebyhand.
Theanswerhastodowithhoweasyyouwantittobetofindtypingmistakesinyourcode.VBScriptprovidesanothercommand,OptionExplicit,whichcausesASPtodisallowimplicitdeclarationsandinsteaddisplayanerrormessagewheneveryoutrytoassignavaluetoanon-existentvariable.Whywouldyouwantthistohappen?
Considerthefollowingexample:
intRomTempC=20'
Ifyouhaveakeeneye,youmayhavenoticedthatthevariablenameismisspelledonthesecondline.Thisisthekindofmistakethatevenexperiencedprogrammersmakeallthetime.Withimplicitdeclarationenabled,thesecondlinewillcreateanothernewvariablecalledintRomTempCandwillstorethevalueinthatvariableinstead.Now,iftherestofyourscriptexpectsthatvaluetobestoredinintRoomTempC,you'
regoingtorunintotrouble.Inalargescript,tracingsuchaproblembacktoonelittletypingmistakecanbeverytimeconsuming.That'
swhereOptionExplicitcomesin:
OptionExplicit'
Disableimplicitdeclaration
Thistime,ASPwillreportthetypingmistakeasanillegalimplicitdeclaration,displayinganerrormessagetothateffectwiththeexactlinenumberwherethetypingmistakewasmade.Forthisreason,ItendtoexplicitlydeclareallmyvariableswithDimandspecifyOptionExplicitonthefirstlineofallofmyASPscripts.Itmighttakeslightlylongertotype,butitsavesalotofheadacheswhensomethinggoeswrong.
Ashortcutexistsforcreatingseveralvariablesatonceonthesameline.Forinstance,thefollowinglinewouldcreatetwovariables,intRoomTempC,andintFreezingC:
DimintRoomTempC,intFreezingC'
Twovariablesinoneline
Bynowyoumaybewonderingaboutmynamingconventionforvariables.Thetwovariablescreatedintheabovesnippetbothbeginwithint.I'
musingthisprefixtoindicatethatthesevariableswillcontainintegers(wholenumbers).Youcanfeelfreetonameyourvariableswhateveryoulikeandstorewhateverkindofdatayoulikeinthem,butIprefertousethisconventionasahelpfulreminderofthetypeofinformationineachvariable.ThispracticeofprefixingvariablenameswithaclueastotheirtypeisknownasHungariannotation,andI'
llintroduceadditionalprefixesforotherdatatypesastheyariseoverthecourseofthisseries.
TheWebhasgrownbeyondthepointwhereanonlinebrochurewillsatisfyatypicalcompany'
sneedsforitsWebpresence.IfyouaimtomarketyourselfasaWebmasterthesedays,youneedtohavesomeskillbuildingonlineapplications–Websitesthatuserscaninteractwith,whethertogetsomethingdone(e.g.sendemail),getinformationtargetedtotheirspecificneeds(e.g.areal-timestockquote),ortointeractwithotherusers(e.g.anonlinecommunity).
Inthisseriesofarticles,I’llguideyouthroughtheprocessoflearningoneofthemostpopularframeworksforcreatingdynamicWebsitessuchasthese–ActiveServerPages(ASP).IfyoucansecureastrongknowledgeofASP,aswellassomepracticalexperiencebuildingWebsiteswithit,youshouldneverhavetroublegettingworkasaWebdeveloper.Aquicksearchofyourfavouriteonlinejobdirectorywiththekeyword'
ASP'
shouldbemorethanenoughtoconvinceyouofthat.
Inthisfirstarticle,I'
llhelpyougetyourfeetwetbyintroducingtheVBScriptprogramminglanguage,andhowtouseittowritedynamicWebpageswithASP.BeforeIgettothat,Ishallstoptoexplainhowserver-sidescripting,andASPinparticular,differsfromotherWebscriptingtechnologiesthatyoumaybefamiliarwith,suchasclient-sideJavaScript.Thiswillgetyouarmedwiththepropervocabularyandensurethatwe'
reonthesamepagebeforelaunchingheadlongintothebrave,newworldofASP.
Server-SideScripting
TounderstandwhereASPfitsintothebigpictureofWebdevelopment,youneedtounderstandtheconceptofaserver-sidescriptinglanguage.Ifyou'
veprogrammedWebpagesinPerl,PHP,JSP,orColdFusionbefore,youcansafelyskipthissection–allofthoseareserver-sidescriptinglanguages,andASPworksinmuchthesameway.Ifyou'
recomingtoASParmedonlywithknowledgeofHTML(andperhapswithsomeCSSand/orJavaScriptexperience)thenyou'
llfindthatserver-sidescriptingisquiteabitdifferent.
Letmebeginbygivingyouaquickreviewofhowstandard,non-ASPWebpageswork.AsshowninFigure1,theWebbrowserontheclientcomputer(thecomputerbelongingtotheuser)makesarequestforapage,sayfile.html
(1).AssumingtherequestedfileexistsontheWebhostcomputerwheretheWebServersoftwarecanfindit,thatsoftwarerepliestotherequestbysendingthefilebacktothebrowser
(2).Anyadditionalfiles(images,forexample)re
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 毕业设计 英文 资料 翻译
![提示](https://static.bdocx.com/images/bang_tan.gif)