2023年全國碩士研究生考試考研英語一試題真題(含答案詳解+作文范文)_第1頁
已閱讀1頁,還剩12頁未讀, 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

1、<p>  畢業(yè)設(shè)計(論文)外文資料翻譯</p><p>  系 部: </p><p>  專 業(yè): </p><p>  姓 名: </

2、p><p>  學 號: </p><p>  外文出處: http://www.hotwired.com/webmonkey/</p><p>  98/39/index2a.html </p><p>  附 件: 1.外文資料翻

3、譯譯文;2.外文原文。 </p><p>  注:請將該封面與附件裝訂成冊。</p><p>  附件1:外文資料翻譯譯文</p><p><b>  ASP簡介</b></p><p>  服務(wù)器端的方案設(shè)計曾經(jīng)相當?shù)睦щy。如果想要通過CGI書寫代碼就必須要求掌握一些編程語言,例如Perl或是C語言,然后導入,這樣的工

4、作效率是非常低的。之后有人改進了CGI技術(shù),一種新的運用于服務(wù)器端的程序產(chǎn)生了。如果你的源程序是用Perl等解釋程序編寫的,服務(wù)器程序就需要運行一個Perl的解釋程序,這樣會占據(jù)處理器許多的時間和內(nèi)存空間。這種情況如果在那些每天采集一千多數(shù)據(jù)的站點后果是十分嚴重的。</p><p>  同樣,你也不可能給程序劃分出一個完美的分界面,就象VB、VC++、或者其他一些程序。你可以通過觀察它們的運行時所產(chǎn)生的錯誤,去檢

5、驗該程序的運行代碼。這是一種對于枯燥乏味的尋找語法錯誤的很有趣的實踐體驗,然而,在此之前必須通過學習認識到在生命中有更好的事情需要做,例如閱讀WiredNew.</p><p>  微軟努力嘗試去通過他們所開發(fā)的ASP技術(shù)去改變以上的那些情況。ASP技術(shù)是由服務(wù)器產(chǎn)生的頁面去指導其他程序執(zhí)行一些操作,例如access databases(按日計工資存?。?,提供不同頁面給不同的基礎(chǔ)瀏覽器,現(xiàn)在我們已經(jīng)很少使用以前的

6、服務(wù)器程序CGI,ASP就如同是一個高效率的提供給服務(wù)器直接運行編碼的解釋程序,并且ASP的工作效率要比CGI高的多,因為ASP主要運行于服務(wù)性工作,并且使用多線程體系結(jié)構(gòu)保持優(yōu)勢。</p><p>  這里是來自Microsoft site的一段解釋:“ASP是一個公開的、編譯快捷的應(yīng)用程序環(huán)境,在這里你可以結(jié)合HTML、源程序、并且可以再度使用ActiveX服務(wù)構(gòu)造來創(chuàng)建動態(tài)的,強有力的基于Web的商業(yè)解決方

7、案。ASP能夠提供服務(wù)器端程序通過自帶的IIS,并且支持VBScript和Jscript兩種腳本語言?!?lt;/p><p>  聽起來很棒,是嗎?但是,要緊記的是ASP并不是治療癌癥的完美的藥方。的確,他可以治愈你的煩惱如果你是一個擁有老資質(zhì)的微軟開發(fā)者,舒適的佇立在壟斷地位。IMNSHO,ASP的提出以致于世界上所有的VB程序?qū)⒃俅伪恍枰?。既然Web必須推擠Unix操作系統(tǒng)之后,成為引人注目的中心。(人們經(jīng)過試驗

8、并且失敗的VB源程序,幾乎因為其自身的一大堆原因而失?。?lt;/p><p>  ASP留下等待,雖然它很有意思,,然而它發(fā)展成為一個“開放的科技框架“,意味著在這個框架中你不需要使用微軟的產(chǎn)品去編寫程序,盡管這仍然是最好的方法。公正的說,在如今,你可以創(chuàng)建ASP網(wǎng)頁使用任何一種語言你所希望的。但是VB源程序仍然是最常用的選擇。這看起來似乎很多人將會選擇使用ASP,--我們做個熱觀的分析--因為所有那些MS開發(fā)者的工

9、具實際上十分優(yōu)秀,并且在書寫上節(jié)約你的時間。ASP同樣可以利用COM和DCOM組件(組建對象模式,并且分布式組成對象模式)提出使用最小的努力。</p><p>  我將會在我的范例中使用VB源程序,然而你也可以使用Jscript(JavaScript或者ECMAScript,或者其他任何一種)脫離了原始的設(shè)計。同樣,一個公司出售為ASP解釋的脫離了原始模式的Perl解決方案,并且在ASP中使用JAVA同樣是十分簡

10、單方便的。我同樣設(shè)想你可以在Windows NT操作系統(tǒng)下使用IIS4.0,即使另一個公司為它提供了另一個服務(wù)器和運行平臺微 如同HTML或者Perl,你同樣可以其他的文字編譯器來編譯創(chuàng)建ASP的程序代碼。微軟VisualInterDev將為你提供精密的數(shù)據(jù)包以及向?qū)?,并且彈出提示,但你可能并不需要那么多的素材?lt;/p><p>  說了這么多,現(xiàn)在讓我們看一些例子吧:</p><p> 

11、 一個ASP程序可以看作一個用許多輔助代碼編寫的HTML文件,并且使用一些不同的分隔符來區(qū)分HTML的各個功能模塊。</p><p>  <% ASP代碼就象這樣%></p><p>  以下是一個ASP代碼的簡單例子</p><p>  <%@ Language=VBScript %> </p><p><b&

12、gt;  <HTML> </b></p><p><b>  <HEAD> </b></p><p>  <TITLE>Example 1</TITLE> </p><p><b>  </HEAD></b></p><p> 

13、 <BODY bgcolor=Lime aLink=DarkTurquoise> </p><p><b>  <P> </P> </b></p><p>  <% Response.Write("Hello, world!") %> </p><p><b

14、>  </BODY> </b></p><p><b>  </HTML></b></p><p>  如果你以ASP文件的形式保存,并且將起導入ASP自帶的運行環(huán)境中,你就會看見在網(wǎng)頁中出現(xiàn)“Hello,World!”的內(nèi)容。不然的話,你句什么也看不見。</p><p>  需要記錄的重點是服務(wù)器是不

15、被允許在分隔符代碼和執(zhí)行程序代碼之間夾雜其他任何東西的,禁止在這里使用HTML語言,否則將會產(chǎn)生錯誤。同樣,在第一行里<%@ Language=VBScript %>,所使用的語言是可以自己選擇的。如果你將這一行省略的話,系統(tǒng)將會默認使用VB腳本語言。</p><p>  VB腳本語言是一種不固定的瑣碎的語言,盡管它支持各種各樣的數(shù)量類型(整型、浮點型、數(shù)據(jù)型、串型等等),VB腳本語言擁有唯一的主要數(shù)

16、據(jù)類型:變量,是一種特殊的數(shù)據(jù)類型可以程序的執(zhí)行過程中按照需要轉(zhuǎn)換自己,這是在編程過程中普遍運用到的。當然,VB語言還擁有所有的程序設(shè)計語言必不可少的操作員,條件語言和控制結(jié)構(gòu)。</p><p>  既然你們已經(jīng)創(chuàng)建了一個頁面,你就應(yīng)該知道一些可能發(fā)生的事情。最好的辦法是,可預言的是微軟公司。他們擁有所有的關(guān)于可用的ASP的內(nèi)置對象的表格,通過一個例子來說明,IIS4同樣有著一些新的精密的數(shù)據(jù)對象,讓你能夠做一些

17、事情就如同寄一封郵件或是向基于開放式數(shù)據(jù)庫胡接的數(shù)據(jù)庫一樣。以下是從微軟公司查閱的對象:</p><p>  · 請求 – 從用戶那里獲取信息。</p><p>  · 響應(yīng) – 發(fā)送消息給用戶。</p><p>  · 服務(wù)器 -- 通過Internet來通知服務(wù)器。</p><p>  ·

18、轉(zhuǎn)換 -- 存儲信息并且轉(zhuǎn)換成用戶當前的使用的網(wǎng)絡(luò)服務(wù)器</p><p>  · 應(yīng)用 – 共享應(yīng)用標準信息并且轉(zhuǎn)換應(yīng)用程序的設(shè)置。</p><p>  以上的每一對象都有一個特定的可以執(zhí)行的功能,叫做“方法”,并且有著一個或者多個道具,每一個都叫做通用定位類型對象代碼[value = Object.Property or value = Object.Method()]。在“

19、Hello,world!”的這個例子中運用到了最常用到的方法中的一個,Response object: write。你可以在ASP允許的范圍之內(nèi)利用對象組建模式來創(chuàng)建對象。微軟公司的新方法是創(chuàng)建面向?qū)ο蟠a。如果你需要一份COM的介紹或者想要知道通過什么道具或方法來表達我的意思,你可以在這里找到詳細的定義。</p><p>  如果你想要制作屬于自己的環(huán)境,你可以通過編寫自己的COM組建對象,或者你還可以從那些多

20、樣性的公司購買。這聽起來似乎已經(jīng)有了一個你需要的對象了。</p><p>  既然你對ASP以及它自帶的對象已經(jīng)有了一個基本的理解,那就讓我們進行更多一點的實踐吧:瀏覽器探測。</p><p>  你可以在瀏覽器探測中很自由的使用客戶端腳本程序,但是如果客戶端服務(wù)器不支持客戶端腳本程序的話,例如Lynx,或者是某人擅自的關(guān)閉了Java腳本程序,你就無法實現(xiàn)操作。</p>&l

21、t;p>  看一看以下的這個使用ASP程序處理這類問題的例子:</p><p>  <%@ Language=VBScript %></p><p><b>  <HTML></b></p><p><b>  <HEAD></b></p><p>  &l

22、t;META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"></p><p><b>  </HEAD></b></p><p><b>  <BODY></b></p><p><b

23、>  <%</b></p><p>  dim BrowserType </p><p>  set bc = Server.CreateObject("MSWC.BrowserType")</p><p>  if bc.browser="IE" then</p><p>  

24、BrowserType = "MSIE"</p><p>  elseif bc.browser="Netscape" then</p><p>  BrowserType = "Netscape"</p><p>  elseif bc.browser="Lynx" then</

25、p><p>  BrowserType = "Lynx"</p><p><b>  end if</b></p><p><b>  %></b></p><p><b>  <%</b></p><p>  select

26、case BrowserType</p><p>  case "Lynx"</p><p>  Response.Write("You're using Lynx! How do you manage to live</p><p>  without 3-D backgrounds and endless download

27、times? Whatever!")</p><p>  case "MSIE"</p><p>  Response.Write("You're using Internet Explorer! Thank you for </p><p>  helping keep Microsoft afloat!&quo

28、t;)</p><p>  case "Netscape"</p><p>  Response.Write("You're using Netscape! And you're wearing those </p><p>  great pink pants! ASP knows everything about y

29、ou!")</p><p><b>  case else</b></p><p>  Response.Write("You're using some other browser I don't know </p><p><b>  about.")</b></p&

30、gt;<p>  End select</p><p><b>  %></b></p><p><b>  <BR></b></p><p><b>  </BODY></b></p><p><b>  </HTM

31、L></b></p><p>  通過運行以上程序你將會發(fā)現(xiàn)你運行的是什么類型的瀏覽器</p><p>  微軟公司已經(jīng)提供了許多類型的對象,例如上述的MSWC.BrowserType,將會使你的生活變得更加簡單。這些服務(wù)器對象的特性,MSWC.BrowserType.browser,比起通常的HTTP_USER_AGENT處理起來更加的簡單,那是因為它并不是向Inter

32、net瀏覽器發(fā)出“Mozilla(兼容性)”的指令,而且你不必去分析語法就如同不必去獲取版本序列號一樣。它的另一個特性是,就象是客戶端的平臺,這有利于代碼的簡化,這是個值得慶幸的事情。隨著再多幾個部件在你的陳述中,你就能夠為所有主要的瀏覽器提供一個頁面、平臺和翻譯組件,這樣的話用戶絕對能夠獲得最好的瀏覽體驗。</p><p>  我們在HotBot中使用類似的一些東西來提供上述所說的腳本程序,服務(wù)器端包含著不同的

33、ASP文件,用以提供給不同的瀏覽器。試著在HotBot中使用Lynx語言,這非常棒。</p><p>  [code snippet: if bc.majorver = "4" and InStr(bc.platform,"Win") <> 0 then ]</p><p>  將運行平臺的信息存儲在站點的HTML頁面信息中將會是一個很好

34、主意,這樣你就不必去一個個的處理服務(wù)器端的那些頁面請求,但是你所真正必須關(guān)心的是你站點的信息傳輸是否通暢。</p><p>  總得說來,ASP確實是一個強有力的工具,而且它也真得很簡單。即使你本身并不想獻身于微軟,使他變得更加強大,這依然回對你有意義,使你能夠考慮一下人們已經(jīng)追趕上了。如果你愿意更多的了解一點ASP的作用,請參考Jay編著的《數(shù)據(jù)庫指南》。</p><p><b&g

35、t;  附件2:外文原文</b></p><p>  Introduction to Active Server Pagesby Kevin Cooke 30 Sep 1998</p><p>  Server-side programming used to be pretty difficult. Making something work via CGI require

36、d some knowledge of arcane programming languages like Perl or C. To boot, it was inefficient. Each time someone hit a CGI script, a new process was created on the server; if your script was written in an interpreted lang

37、uage like Perl, the server had to start up another Perl interpreter, taking up processing time and memory. The situation got even hairier when it lived on a site that was getting a few thous</p><p>  Also, y

38、ou couldn't program in any of the nifty development interfaces, like Visual Basic or Visual C++ or Visual Anything. You were limited to watching it crash and burn, then checking out the server logs. This experience w

39、as good practice for catching stupid syntax errors, but I have since learned that I have better things to do with my life, like read. </p><p>  Microsoft attempted to change all this when they introduced Act

40、ive Server Pages. ASPs are server-generated pages which can call other programs to do things like, serve different pages to different browsers - basically, anything we used to do with CGI. ASP is almost as efficient as w

41、riting code directly to the server's application program interface, and it's a lot more efficient than CGI because it runs as a service and can take advantage of multithreaded architectures. </p><p>

42、  Here's the official word from the: "Active Server Pages is an open, compile-free application environment in which you can combine HTML, scripts, and reusable ActiveX server components to create dynamic and pow

43、erful Web-based business solutions. Active Server Pages enables server-side scripting for IIS with native support for both VBScript and Jscript." </p><p>  Sounds great, right? But keep in mind that ASP

44、 is not a cure for cancer. True, it might heal what ails you if you're an old-school Microsoft developer who's comfortable staying in Monopoly Land. IMNSHO, ASP was introduced so that all the Visual Basic program

45、mers in the world would feel needed again, now that the Web had shoved Unix geeks back into the limelight (they tried and failed with VBScript, which pretty much died for a whole host of reasons). </p><p>  

46、ASP stuck around, though, because it made sense. It evolved into an "open technology framework," meaning you didn't have to use Microsoft products to create code in it, though that's still the best way

47、to go, honestly. Nowadays, you can create ASP pages using whatever language you want, but VBScript is still the most common choice. It seems likely that more people will choose to use ASP - we do on HotBot - because all

48、of those MS developer tools are actually pretty good and written to save you t</p><p>  I'll be using VBScript in my examples, but you can use JScript (JavaScript or ECMAScript or whatever) out of the bo

49、x, too. Also, one company sells an for ASP, and Java is pretty easy to use with ASP, too. I'll also assume that you're using IIS 4.0 on Windows NT, even though another has ported it to other servers and platforms

50、. Like HTML and Perl, you can use any text editor to create ASP code. Microsoft VisualInterDev will give you nice highlights and wizards and pop-up boxes, but you may not ne</p><p>  All set? Then let's

51、take a look at the code. </p><p>  An Active Server Page is an HTML file with some additional code in it, separated from the HTML markup by a different delimiter: </p><p>  <% ASP Code evalua

52、ted here %></p><p>  Here's an example page: </p><p>  <%@ Language=VBScript %> </p><p><b>  <HTML> </b></p><p><b>  <HEAD> &

53、lt;/b></p><p>  <TITLE>Example 1</TITLE> </p><p><b>  </HEAD></b></p><p>  <BODY bgcolor=Lime aLink=DarkTurquoise> </p><p><b&

54、gt;  <P> </P> </b></p><p>  <% Response.Write("Hello, world!") %> </p><p><b>  </BODY> </b></p><p><b>  </HTML>

55、;</b></p><p>  If you save this file as .asp and put it on an ASP-ready server, you'll see the "Hello, world!" in the page above. If you don't, you shouldn't see anything. </p&

56、gt;<p>  The important thing to note is that the server will assume that anything between the delimiters is code and will then try to execute it. Don't put HTML there, or else it'll break. Also, the first

57、line, <%@ Language=VBScript %> is optional. If you leave it out, the server will assume you're using VBScript. </p><p>  VBScript is an odd little language. Although it supports various scalar valu

58、es (integers, floating-point numbers, strings, etc.), VBScript has only one primary data type: the Variant, a peculiar data type that magically transforms itself to fit within the context in which it is currently being u

59、sed. Of course, VBScript has all the requisite programming-language operators, conditional statements, and control structures. </p><p>  Now that you've created one page, you're going to want to know

60、 what else is possible. The best resource, predictably, is at Microsoft. They have a complete list of available built-in ASP objects, with example code. IIS4 comes with some nice new objects, too, letting you do things l

61、ike send mail and talk to ODBC-based databases. Here's the scoop on these objects from the: </p><p>  Request - to get information from the user </p><p>  Response - to send information to

62、 the user </p><p>  Server - to control the Internet Information Server </p><p>  Session - to store information about and change settings for the user's current Web-server session </p&

63、gt;<p>  Application - to share application-level information and control settings for the lifetime of the application </p><p>  Each of these objects has a collection of functions that it can perform

64、, called "methods," and one or more properties, each called with the usual object-orientation-style code [value = Object.Property or value = Object.Method()]. The "Hello, world!" example above uses on

65、e of the most common methods of the Response object: write. You can create objects that are ASP-accessible by using the Component Object Model, Microsoft's new way of creating OO code. If you need an intro to COM or

66、need to know </p><p>  If you want to make your own widgets, you can either write your own COM objects or you can buy them from a variety of companies. It's likely that there is already an object out the

67、re that does what you need. </p><p>  Now that you have a basic understanding of ASP and its related objects, let's try something a little more practical: browser detection.</p><p>  You can

68、 obviously use client-side scripting for browser detection, but if the client doesn't support client-side scripting, like Lynx, or people who are paranoid and turn JavaScript off, you're hosed. </p><p&

69、gt;  Take a look at this example for an idea of how ASP can handle this problem: </p><p>  <%@ Language=VBScript %></p><p><b>  <HTML></b></p><p><b>  

70、<HEAD></b></p><p>  <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"></p><p><b>  </HEAD></b></p><p><b>  &

71、lt;BODY></b></p><p><b>  <%</b></p><p>  dim BrowserType </p><p>  set bc = Server.CreateObject("MSWC.BrowserType")</p><p>  if bc.bro

72、wser="IE" then</p><p>  BrowserType = "MSIE"</p><p>  elseif bc.browser="Netscape" then</p><p>  BrowserType = "Netscape"</p><p>

73、;  elseif bc.browser="Lynx" then</p><p>  BrowserType = "Lynx"</p><p><b>  end if</b></p><p><b>  %></b></p><p><b>

74、  <%</b></p><p>  select case BrowserType</p><p>  case "Lynx"</p><p>  Response.Write("You're using Lynx! How do you manage to live</p><p>

75、  without 3-D backgrounds and endless download times? Whatever!")</p><p>  case "MSIE"</p><p>  Response.Write("You're using Internet Explorer! Thank you for </p>

76、<p>  helping keep Microsoft afloat!")</p><p>  case "Netscape"</p><p>  Response.Write("You're using Netscape! And you're wearing those </p><p> 

77、 great pink pants! ASP knows everything about you!")</p><p><b>  case else</b></p><p>  Response.Write("You're using some other browser I don't know </p><

78、;p><b>  about.")</b></p><p>  End select</p><p><b>  %></b></p><p><b>  <BR></b></p><p><b>  </BODY><

79、;/b></p><p><b>  </HTML></b></p><p>  The results of this code should tell you what type of browser you're running. </p><p>  The folks at Microsoft have pr

80、ovided lots of objects, like the MSWC.BrowserType above, which can make your life easier. This server object's property, MSWC.BrowserType.browser, is much simpler to deal with than the usual HTTP_USER_AGENT because i

81、t doesn't say"Mozilla (compatible)" for Internet Explorer, and you don't have to parse the string just to get the version number. It's another property, (majorver), as is the client platform (platfo

82、rm). It just makes for cleaner code, which is always a g</p><p>  We use something similar at HotBot for the above script to server-side-include different ASP files for different browsers. Try using HotBot w

83、ith Lynx - it's groovy! </p><p>  [code snippet: if bc.majorver = "4" and InStr(bc.platform,"Win") <> 0 then ]</p><p>  It would be a good idea to store the platfor

84、m information on a cookie, so you don't have to do all of the server-side processing with every request for this page, but only if you're really concerned about traffic on your site. </p><p>  In sum

85、, ASP is pretty powerful stuff, and it's fairly easy. Even if you personally don't want to contribute to Microsoft's growing power, it might make sense for you to take a look at what the folks in Redmond have

溫馨提示

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

評論

0/150

提交評論