計算機(jī)專業(yè)外文翻譯+原文-ASP語言知識介紹.doc_第1頁
計算機(jī)專業(yè)外文翻譯+原文-ASP語言知識介紹.doc_第2頁
計算機(jī)專業(yè)外文翻譯+原文-ASP語言知識介紹.doc_第3頁
計算機(jī)專業(yè)外文翻譯+原文-ASP語言知識介紹.doc_第4頁
計算機(jī)專業(yè)外文翻譯+原文-ASP語言知識介紹.doc_第5頁
已閱讀5頁,還剩12頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

畢 業(yè) 設(shè) 計(論 文) 英 文 翻 譯 學(xué) 院: 信息技術(shù)學(xué)院 專 業(yè): 計算機(jī)科學(xué)與技術(shù) 學(xué)生姓名: 王佩 學(xué) 號: 0506120502 題 目: 基于Web的網(wǎng)絡(luò)商品銷售系統(tǒng) 指 導(dǎo) 教 師: 張 漪 日期: 2009年 2月 27 日(中文文獻(xiàn))MicrosoftActiveServerPages即我們所稱的ASP,其實(shí)是一套微軟開發(fā)的服務(wù)器端腳本環(huán)境,ASP內(nèi)含于IIS3.0和4.0之中,通過ASP我們可以結(jié)合HTML網(wǎng)頁、ASP指令和ActiveX元件建立動態(tài)、交互且高效的WEB服務(wù)器應(yīng)用程序。有了ASP你就不必?fù)?dān)心客戶的瀏覽器是否能運(yùn)行你所編寫的代碼,因?yàn)樗械某绦蚨紝⒃诜?wù)器端執(zhí)行,包括所有嵌在普通HTML中的腳本程序。當(dāng)程序執(zhí)行完畢后,服務(wù)器僅將執(zhí)行的結(jié)果返回給客戶瀏覽器,這樣也就減輕了客戶端瀏覽器的負(fù)擔(dān),大大提高了交互的速度。以下羅列了ActiveServerPages所獨(dú)具的一些特點(diǎn):1.使用VBScript簡單易懂的腳本語言,結(jié)合HTML代碼,即可快速地完成網(wǎng)站的應(yīng)用程序。2.無須compile編譯,容易編寫,可在服務(wù)器端直接執(zhí)行。3.使用普通的文本編輯器,如Windows的記事本,即可進(jìn)行編輯設(shè)計。4.與瀏覽器無關(guān)(BrowserIndependence),用戶端只要使用可執(zhí)行HTML碼的瀏覽器,即可瀏覽ActiveServerPages所設(shè)計的網(wǎng)頁內(nèi)容。ActiveServerPages所使用的腳本語言(VBScript、Jscript)均在WEB服務(wù)器端執(zhí)行,用戶端的瀏覽器不需要能夠執(zhí)行這些腳本語言。5.ActiveServerPages能與任何ActiveXscripting語言相容。除了可使用VBScript或JScript語言來設(shè)計外,還通過plug-in的方式,使用由第三方所提供的其他腳本語言,譬如REXX、Perl、Tcl等。腳本引擎是處理腳本程序的COM(ComponentObjectModel)物件。6.ActiveServerPages的源程序,不會被傳到客戶瀏覽器,因而可以避免所寫的源程序被他人剽竊,也提高了程序的安全性。7.可使用服務(wù)器端的腳本來產(chǎn)生客戶端的腳本。8.物件導(dǎo)向(Object-oriented)。9.ActiveXServerComponents(ActiveX服務(wù)器元件)具有無限可擴(kuò)充性??梢允褂肰isualBasic、Java、VisualC+、COBOL等編程語言來編寫你所需要的ActiveXServerComponent。ASP的奇妙之處真是不勝枚舉,下面就請各位系好安全帶,我將帶領(lǐng)大家進(jìn)入ASP的夢幻世界。ASP運(yùn)行環(huán)境:MicrosoftInternetInformationServerversion3.0/4.0onWindowsNTServerMicrosoftPeerWebServicesVersion3.0onWindowsNTWorkstationMicrosoftPersonalWebServeronWindows95/98正如前文所述,與一般的程序不同,.asp程序無須編譯,ASP程序的控制部份,是使用VBScript、JScript等腳本語言來設(shè)計的,當(dāng)執(zhí)行ASP程序時,腳本程序?qū)⒁徽酌畎l(fā)送給腳本解釋器(即腳本引擎),由腳本解釋器進(jìn)行翻譯并將其轉(zhuǎn)換成服務(wù)器所能執(zhí)行的命令。當(dāng)然,同其他編程語言一樣,ASP程序的編寫也遵循一定的規(guī)則,如果你想使用你所喜愛的腳本語言編寫ASP程序,那么你的服務(wù)器上必須要有能解釋這種腳本語言的腳本解釋器。當(dāng)你安裝ASP時,系統(tǒng)提供了兩種腳本語言:VBsrcipt和JScript,而VBscript則被作為系統(tǒng)默認(rèn)的腳本語言。你也可以根據(jù)自己的喜好改變系統(tǒng)默認(rèn)的腳本語言。ASP本身并不是一種腳本語言,它只是提供了一種使鑲嵌在HTML頁面中的腳本程序得以運(yùn)行的環(huán)境。但是,要學(xué)好ASP又必須掌握它的語法和規(guī)則?,F(xiàn)在就讓我們開始一步一步地認(rèn)識并學(xué)習(xí)ActiveServerPages。ASP程序其實(shí)是以擴(kuò)展名為.asp的純文本形式存在于WEB服務(wù)器上的,你可以用任何文本編輯器打開它,ASP程序中可以包含純文本、HTML標(biāo)記以及腳本命令。你只需將.asp程序放在WEB服務(wù)器的虛擬目錄下(該目錄必須要有可執(zhí)行權(quán)限),就可以通過WWW的方式訪問ASP程序了。要學(xué)好ASP程序的設(shè)計,必須掌握腳本的編寫,那么究竟什么是腳本呢?其實(shí)腳本是由一系列的腳本命令所組成的,如同一般的程序,腳本可以將一個值賦給一個變量,可以命令WEB服務(wù)器發(fā)送一個值到客戶瀏覽器,還可以將一系列命令定義成一個過程。要編寫腳本,你必須要熟悉至少一門腳本語言,如VBScript。腳本語言是一種介乎于HTML和諸如JAVA、VisualBasic、C+等編程語言之間的一種特殊的語言,盡管它更接近后者,但它卻不具有編程語言復(fù)雜、嚴(yán)謹(jǐn)?shù)恼Z法和規(guī)則。如前所述ASP所提供的腳本運(yùn)行環(huán)境可支持多種腳本語言,譬如:JScript、REXX、PERL等等,這無疑給ASP程序設(shè)計者提供了廣泛的發(fā)揮余地。ASP的出現(xiàn)使得廣大WEB設(shè)計者不必在為客戶瀏覽器是否支持而擔(dān)心,實(shí)際上就算你在同一個.asp文件中使用不同的腳本語言,你都無須為此擔(dān)憂,因?yàn)樗械囊磺卸紝⒃诜?wù)器端進(jìn)行,客戶瀏覽器得到的只是一個程序執(zhí)行的結(jié)果,而你也只需在.asp中聲明使用不同的腳本語言即可。下面是一個典型的在同一.asp文件中使用兩種腳本語言的例子:SubCallmeResponse.WriteCallMeEndSubfunctionViewDate()varxx=newDate()Response.Write(x.toString()這是各位在本文中接觸的第一個真正的ASP程序,千萬不要被“”符號搞糊涂,這其實(shí)是標(biāo)準(zhǔn)的ASP定界符,而“”之間的就是腳本語言。ASP不同于腳本語言,它有自己特定的語法,所有的ASP命令都必須包含在之內(nèi),如:,ASP通過包含在中的表達(dá)式將執(zhí)行結(jié)果輸出到客戶瀏覽器,如:就是將前面賦給變量test的值English發(fā)送到客戶瀏覽器中,而當(dāng)變量test的值為Mathematics時,以下程序:Thisweekendwewilltest.在客戶瀏覽器中則顯示為:ThisweekendwewilltestMathematics.學(xué)習(xí)ASP最好的方法莫過于親自動手編寫,為了在最短的時間內(nèi)使各位掌握ASP的程序設(shè)計技巧,本文將采取實(shí)例分析法,通過一系列的實(shí)例讓各位在實(shí)踐中學(xué)習(xí)ASP。建立一個ASP頁面,你所需的只是打開一個文本編輯器,如:Notepad,然后跟我開始動手編寫第一個ASP程序。下面我們將建立一個自動監(jiān)測瀏覽時間并根據(jù)不同時段動態(tài)顯示不同頁面內(nèi)容的ASP程序,請將以下代碼剪貼到你的文本編輯器中,并存為test1.asp:%IfTime=#00:00:00#Then%早上好,今天天氣不賴啊!%ElseIfTime=#12:00:00#Then%下午好!哈嘍!今晚你有沒有去IRC聊天!將test1.asp保存在WEB服務(wù)器的虛擬目錄(如:aspsamp/)下,并在瀏覽器中用HTTP的方式進(jìn)行瀏覽:http:/yourcomputername/aspsamp/test1.asp,你將會新奇地發(fā)現(xiàn),你的頁面真的活起來了。雖然,這只是一個非常簡單的實(shí)例,而且這一功能完全可以通過JavaScript完成,但是不難發(fā)現(xiàn)使用ASP要比JavaScript簡潔、迅速得多,而且運(yùn)用此法,你完全可以輕而易舉地令你的網(wǎng)頁在不同的時段展示不同的風(fēng)格。此例中的“Time”實(shí)際上是一個VBScript內(nèi)置的顯示系統(tǒng)當(dāng)前時間的函數(shù),由于系統(tǒng)默認(rèn)的腳本語言是VBScript,因此當(dāng)你在ASP命令中調(diào)用該函數(shù)時,腳本引擎會自動將其轉(zhuǎn)換成當(dāng)前的系統(tǒng)時間。接下來我們將給test1.asp添加一點(diǎn)色彩,在標(biāo)識中添加“bgcolor=”即變?yōu)閎odybgcolor=,并在標(biāo)記前添加如下語句:%IfTime=#00:00:00#Thenbgc=silverElseIfTime=#12:00:00#Thenbgc=navyElsebgc=redEndIf%如此一來,當(dāng)用戶在不同的時段訪問你的頁面時,他們將會看到不同的頁面背景色。我們可以做的事情還有很多,譬如你想知道在凌晨至十二點(diǎn)之間瀏覽你頁面的客戶的姓名,并向他或她問好,那么下面的這段程序?qū)⒛苤氵_(dá)成心愿。首先你需要在頁面中設(shè)置表單,將以下HTML代碼剪貼到“%IfTime=#00:00:00#Then%”之后:歡迎光臨我的主頁,請?zhí)顚懸韵滦畔?FirstName:LastName:Title:Mr.Ms.然后在以上HTML代碼后面添加如下ASP命令:歡迎您Mr.。歡迎您Ms.。歡迎您。保存文件test1.asp,并在瀏覽器中以HTTP方式進(jìn)行瀏覽,如果此時的系統(tǒng)時間在凌晨0:00:00和中午12:00:00之間的話,瀏覽器將顯示如下畫面:這其實(shí)是一個在Internet和Intranet上常見的功能,即當(dāng)用戶在瀏覽器端填寫完表單后,通過調(diào)用一個通用網(wǎng)關(guān)程序?qū)⒂脩魯?shù)據(jù)傳送到服務(wù)器,由服務(wù)器進(jìn)行處理后再將結(jié)果返還給客戶瀏覽器。過去為了實(shí)現(xiàn)這樣的功能必須編寫一個獨(dú)立于HTML之外的CGI程序,并通過HTML進(jìn)行調(diào)用,撇開CGI編寫復(fù)雜等缺點(diǎn)不談,CGI的執(zhí)行效率也是一個大問題,每一個表單(form)均須執(zhí)行一個可執(zhí)行文檔,當(dāng)多人同時上線使用時,多個文檔同時執(zhí)行,將大大降低WEB服務(wù)器的執(zhí)行速度,如今ASP提供了與HTML完全相融的編程環(huán)境,顯然要比使用CGI便捷得多。在本期的最后讓我們再來看看ASP的循環(huán)功能,譬如你希望當(dāng)客戶在晚間7:00至凌晨0:00:00瀏覽你的頁面時,在頁面中央顯示6個笑臉表示問候,那么你只需要將以下命令剪貼到“GoodEvening!”后面即可:這是一個最最基本的循環(huán)語句,它將一個笑臉圖片重復(fù)調(diào)用六次并顯示在頁面上。當(dāng)然此例的效果完全可以用HTML做到,但是不難發(fā)現(xiàn)使用ASP大大縮短了代碼的重復(fù)編寫,使得程序具有良好的可閱讀性。另外,當(dāng)你制作一個諸如根據(jù)用戶投票來給所評測的對象評定星級的評測站點(diǎn)時,使用此法,你就完全不需要為每一個星級制作一幅圖片。如果一個對象被評為4星級,那只需將一顆星的圖片循環(huán)顯示4次,類推即可。-摘自ASP語言知識介紹 作者:Johnson/cliktoprogram/asp/introduction.asp(外文翻譯)Microsoft Active Server Pages namely I an ASP for calling, its solid is a set of tiny and soft open a machine of the hair carry feet this wreath , the inside of ASP is contained in IIS 3.0 with 4.0 it is inside, over ASP I can match with the knot the HTML net page, ASP point the ream to should use the distance preface with the ActiveX a WEB for setting up moving , handing over with each other and high effect a machine. There is ASP you not necessarily a heart a distance for of the machine of is on behalf to denies to can carry a line of you a plait write code, because of for having preface will carry a feet for, of pack contain in HTML this distance preface in a machine. The distance preface line is over to finish behind, a machine only a negative load for of knot fruit returning returning to a machine, this kind too reducing lightly a door carrying the machine of , big and big lift high hand over with each other and soon degree. Then next row the Active Server Pages has only of a the amount is with ordering: 1. Make use VBScript, JScript.etc. Chien single easily feet this language that understand talks, the knot matches the HTML on behalf code, canning be over quickly and soon namely the net stands of should use the distance preface. 2. Have no must compile the plait translates, permitting the easy plait write, can carry to keep connecting in a machine the line of . 3. Make text this plait machine that use the , if the Windows records the matter this, can enter namely a plait establishes to account. 4. Have no pass( Browser Independence) with the machine of , use a the machine of for carrying want to make use can a HTML code, namely can the Active Server Pages a net for establishing accounting page inside permit. Active Server Pages a feet for making using this language speech( VBScript, Jscript) all carries in the WEB a machine a the machine of for, using first the door carry does not need to want can enough a this amounts feet this language speech. 5.Active Server Pages can with term why the ActiveX scripting language speech permits mutually. In addition to canning make establish with VBScript or JScript language speeches to account, return the over the plug- in square type, make use from the third an its his feet for lifting providing this language speech,such as REXX, Perl, etc. of Tcl,. Feet this lead is the COM( Component Object Model) thing piece of a reason feet this distance preface. 6.Active Server Pages source distance preface, cant were spread a machine, because of and can to avoid to do not need a source for writing distance preface drive his person , also lift high the peaceful whole sex of the distance preface. 7. Can make use the feet that a machine carry this produce to living a feet for the door carry this. 8. The thing piece leads the direction.( Object- oriented) 9.The ActiveX Server Components( ActiveX a machine a piece) have to have no limit can . Can to make to use the Visual Basic, Java, Visual C+, COBOL etc. plait distance language speech weaves to write your an ActiveX for needing wanting Server Component. ASP strange and wonderful a dream for true is not of raising, descending pleasing eachly is very peaceful and allly taking, I will taking getting big house entering into ASP a life time boundary. A wreath for first, letting I coming seeing carrying a line ofly the ASP need : Microsoft Internet Information Server version 3.0/4.0 on Windows NT Server Microsoft Peer Web Services Version 3.0 on Windows NT Workstation Microsoft Personal Web Server on Windows 95/98 It is positive to is not such as the ex- text a distance for saying, with first sort preface together,.The asp distance preface has no and must weave to translate, the ASP distance preface controls to make a, is to make establish with VBScript, JScript.etc. feet this language speech to account of, be the an ASP distance preface, feet this distance preface will a the whole set of life ream hair sends to release feet this solution the machine( namely feet this lead the ), being released by feet this solution the machine enter a line of turning over to translate to combine its turn to change a life for can the line of ream. When however, together its he weave the distance language talks a kind, the ASP distance preface plait writes too the follows a the rules that settle is then, such as fruit you wants to make use your a feet for pleased love this language speech plait writes the ASP distance preface, that you of a machine the top must have necessarily and can solve feet this solution that release this type of feet this language speech releases the machine. When you are peaceful to pack the ASP, is the lifted to provide two kinds of feets this language speech: VBsrcipt with JScript, but the VBscript were then made for is feet this language speech that recognize. You too can with root according to from F of pleased like to change to become is feet this language speech that recognize. ASP this body is not a kind of feet this language to talk, its is a wreath to lifted to provide a kind of making got in HTML page feet in this distance preface to carry line . But is, to learn the good ASP again and necessarily must the language method that hold it is then with the rules. Now at let I open to start a step per step ground recognizes to know to combine to learn the Active Server Pages. ASP distance preface its solid regard exhibition as.Asp pure text this form type save to can contain with the pack in on the WEB a machine of, you can then use term why text this plait machine beat open it, ASP distance preface the pure text this, HTML mark records with and feet this life makes. You need only.The asp distance preface puts the in WEB a machine intends eyes record the bottom( that eyes record to must have necessarily can a power limit), can visited to ask the ASP distance preface over the WWW square type with the . Toing learn the good ASP distance preface establish to account, necessarily must the plait that hold the feet this write, that investigate unexpectedly the is a feet this? Its solid feet this is from an is feet this life ream a set of the row of, such as together a the distance preface of the sort, feet this can to give a worth a changes the deal, can make the WEB a machine hair send a value with the life a machine, can also with will an is row life the ream settles the righteousness an over distance. To weave to write the feet this, you must want to be familiar necessarily all to little a feet this language speech, such as VBScript.Feet this language speech is a kind of lying in HTML with ,such as JAVA, Visual Basic, C,+ etc. weaves the distance language speech a language for of a kind ofly with talks, doing to take care of it even connect the near empress, but it does not have the plait distance language the speech reply the language method of the miscellaneous and strict to is then with rules. Such as the ex- a feet for saying first of ASP lifting to provide this carries a wreath can hold to grow feet this language speech more, such as: JScript, REXX, PERL.etc. etc., this have no the establishes the ASP distance preface to account lift the hair that provided the wide flicks remaining ground. The ASP makes now the widely big WEB establishes to account not necessarily at is to denies for a machine hold but a heart, solid on the occasion of top calculate you at together a.Asp text a feet for inside making using not together this language talks, you have no must for this load of , you also need only at because of have on slicing for to will carry into in a machine a for, a machine have to arriving is the knot fruit of a distance preface line,.Asp inside a feet for clearly making using not together this language speech is namely can. Bottom is a type of at together a.Asp text a son: Sub Callme Response.Write CallMeEnd Sub function ViewDate() var x x = new Date() Response.Write(x.toString() This is each one to connect the in this text a true positive ASP distance preface,1000 10000 do not want the quilt sign number make the draws, this its solid is an ASP to mark to allow to settle the boundary sign, but the is feet this language speech. ASP not talk in feet this language together, it have from the F with the language method that settle, an ASP for having life ream all and necessarily must the pack contain in of, such as: , the ASP loses the a knot fruit to over a form for containing in reach type machine, such as: is to give worth the hair of English the that change the deal test to send to a machine inside, but when change the value of the deal test as the Mathematics, then next distance preface: This weekend we will test . Then show to show in a machine for: This weekend we will test Mathematics. Learn the ASP good of square method over in close from move the hand plait write, for make the each hold the ASP distance preface to establish to account the skill in the most shortly hour, this text will adopt to take the solid a cent method, over an is the solid example of the row let each one learn the ASP in solid . Set up an ASP page, you a for needing is to beats to open a text this plait machine, such as: Notepad, however open to start to move with me behind the hand plait write the first ASP distance preface. Bottom I will set up an ASP for from moving measuring hour in combining first root according to not together hour the segment moves the shows to show not together the page inside permit distance preface, please shear the then next on behalf code to text this plait machine inside that stick to you, combine to save for test1.asp: % If Time = #00:00:00# Then %Last early good, a spirit do not depend on now! % ElseIf Time = #12:00:00# Then %Bottom the noon is good!hello ! Now late you have and did not go to the IRC chats for day! Protect to save the test1.asp the in WEB a machine intend eyes record( such as: Aspsamp/) bottom, combine in the machine of the square type of using the HTTP enters , such as: Http:/ yourcomputername/ aspsamp/ test1.asp, you will be new hair strangely now, you of the page is really live to rises to come. Although however, this only is a not often single solid example in Chien, but and this can be over and all and can is over over the JavaScript with the , is a not difficult hair to make want to compare with the ASP JavaScript Chiens now, fast get soon many, but and carries to use this method, you are over and all can with light but raise a hour of net page at not together an exhibition that makes you showing easily not together of breeze space. This Time in the example is solid on the occasion of the top is a VBScript inside to place of show to show is a feet for of letter counting, from in is recognizing this language speech for to be front is a VBScript, being you because of this to adjust to use that letter in ASP life ream several, feet this leads would from move its turn to change before being of is hour.Connect the bottom to me will add the test1.asp to add some color , add to add the bgcolor= the change namely for the body bgcolor the = in mark knew, combine to mark at the before recording adds to add such as the nex

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論