物業(yè)管理系統(tǒng)外文翻譯_第1頁
物業(yè)管理系統(tǒng)外文翻譯_第2頁
物業(yè)管理系統(tǒng)外文翻譯_第3頁
物業(yè)管理系統(tǒng)外文翻譯_第4頁
物業(yè)管理系統(tǒng)外文翻譯_第5頁
已閱讀5頁,還剩8頁未讀, 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

1、 外 文 翻 譯畢業(yè)設計題目: 基于ASP.NET的 物業(yè)管理系統(tǒng)開發(fā) 原文1: ASP.NET 2.0 Web Pages and Web Controls 譯文1: ASP.NET 2.0 網(wǎng)頁和Web控件 原文2:The Role of Global.asax File譯文2: Global.asax文件的作用 原文1ASP.NET 2.0 Web Pages and Web ControlsUntil now, all of the example applications in this text have focused on console-based and Windows F

2、orms front ends. In this chapter and the next, youll explore how the .NET platform facilitates the construction of browser-based presentation layers. To begin, youll quickly review a number of key web-centric concepts (HTTP, HTML, client-side, and server-side script) and the role of the web server (

3、including the ASP.NET development server, WebDev.WebServer.exe).With this web primer out of the way, the remainder of this chapter concentrates on the composition of ASP.NET (including the enhanced code-behind model) and how to work with ASP.NET web controls. As you will see, ASP.NET 2.0 provides a

4、number of new web controls, a new “master page”model, and various customization techniques.The Role of HTTPWeb applications are very different animals from traditional desktop applications (to say the least).The first obvious difference is that a production-level web application will always involve

5、at least two networked machines (of course, during development it is entirely possible to have a single machine play the role of both client and server). Given this fact, the machines in question must agree upon a particular wire protocol to determine how to send and receive data. The wire protocol

6、that connects the computers in question is the Hypertext Transfer Protocol (HTTP).When a client machine launches a web browser (such as Netscape Navigator, Mozilla Firefox,or Microsoft Internet Explorer), an HTTP request is made to access a particular resource (such as an *.aspx or *.htm file) on th

7、e remote server machine. HTTP is a text-based protocol that is built upon a standard request/response paradigm. For example, if you navigate to www. IntertechT, the browser software leverages a web technology termed Domain Name Service (DNS) that converts the registered URL into a four-pa

8、rt, 32-bit numerical value (aka an IP address). At this point, the browser opens a socket connection (typically via port 80) and sends the HTTP request for the default page at the http:/www.IntertechT website.Once the hosting web server receives the incoming HTTP request, the specified re

9、source may contain logic that scrapes out any client-supplied input values (such as values within a text box) in order to format a proper HTTP response. Web programmers may leverage any number of technologies(CGI, ASP, ASP.NET, Java servlets, etc.) to dynamically generate the content to be emitted i

10、nto the HTTP response. At this point, the client-side browser renders the HTML emitted from the web server. Another aspect of web development that is markedly different from traditional desktop programming is the fact that HTTP is an essentially stateless wire protocol. As soon as the web server emi

11、ts a response to the client, everything about the previous interaction is forgotten. Therefore, as a web developer, it is up to you take specific steps to “remember” information (such as items in a shopping cart) about the clients who are currently logged on to your site. As you will see in the next

12、 chapter, ASP.NET provides numerous ways to handle state, many of which are commonplace to any web platform (session variables, cookies, and application variables) as well as some new techniques (view state, control state, and the cache).Understanding Web Applications and Web ServersA web applicatio

13、n can be understood as a collection of files (*.htm, *.asp, *.aspx, image files, etc.) and related components (such as a .NET code library) stored within a particular set of directories on a given web server. As shown in Chapter 24, web applications have a specific life cycle and provide numerous ev

14、ents (such as initial startup or final shutdown) that you can hook into.A web server is a software product in charge of hosting your web applications, and it typically provides a number of related services such as integrated security, File Transfer Protocol (FTP) support, mail exchange services, and

15、 so forth. Internet Information Server (IIS) is Microsofts enterprise-level web server product, and as you would guess, it has intrinsic support for classic ASP as well as ASP.NET web applications.When you build ASP.NET web applications, you will often need to interact with IIS. Be aware, however, t

16、hat IIS is not automatically selected when you install the Windows Server 2003 or Windows XP Professional Edition (you cant install IIS on the Home editions of Windows). Therefore, depending on the configuration of your development machine, you may be required to manually install IIS before proceedi

17、ng through this chapter. To do so, simply access the Add/Remove Program applet from the Control Panel folder and select Add/Remove Windows Components.Working with IIS Virtual DirectoriesA single IIS installation is able to host numerous web applications, each of which resides in a virtual directory.

18、 Each virtual directory is mapped to a physical directory on the local hard drive. Therefore, if you create a new virtual directory named CarsRUs, the outside world can navigate to this site using a URL such as http:/www.CarsRU (assuming your sites IP address has been registered with the world

19、at large). Under the hood, the virtual directory maps to a physical root directory such as C:inetpubwwwrootAspNetCarsSite, which contains the content of the web application.When you create ASP.NET web applications using Visual Studio 2005, you have the option of generating a new virtual directory fo

20、r the current website. However, you are also able to manually create a virtual directory by hand. For the sake of illustration, assume you wish to create a simple web application named Cars. The first step is to create a new folder on your machine to hold the collection of files that constitute this

21、 new site (e.g., C:CodeTestsCarsWebSite).Next, you need to create a new virtual directory to host the Cars site. Simply right-click the Default Web Site node of IIS and select New Virtual Directory from the context menu. This menu selection launches an integrated wizard. Skip past the welcome screen

22、 and give your website a name (Cars). Next, you are asked to specify the physical folder on your hard drive that contains the various files and images that represent this site (in this case, C:CodeTestsCarsWebSite).The final step of the wizard prompts you for some basic traits about your new virtual

23、 directory (such as read/write access to the files it contains, the ability to view these files from a web browser, the ability to launch executables e.g., CGI applications, etc.). For this example, the default selections are just fine (be aware that you can always modify your selections after runni

24、ng this tool using various right-click Property dialog boxes integrated within IIS).譯文1作者:迪諾弗雷國籍:美國出處:ASP.NET 2.0 and Data-Bound ControlsASP.NET 2.0網(wǎng)頁和Web控件到現(xiàn)在為止,本書的示例應用程序主要集中在控制臺和基于Windows窗體前端。在本章及下面學習中,將探討如何用.NET平臺促進瀏覽器的建設。首先,你很快就會再次看到關(guān)于網(wǎng)絡中心的概念(HTTP,HTML格式,客戶端和服務器端腳本)和web服務器(包括ASP.NET開發(fā)服務器,WebDev.

25、WebServer作用。exe文件)。了這一點,本章的剩余部分主要是ASP網(wǎng)絡(包括增強的代碼隱藏模型),以及如何使用ASP.NET Web控件和ASP.NET組成。正如你所看到的,ASP.NET 2.0提供了一些新的網(wǎng)絡控制模式,新的“母版頁”的模式,以及各種定制技術(shù)。HTTP的作用Web應用程序不同于傳統(tǒng)的桌面應用程序。第一個明顯不同的是,產(chǎn)生Web應用程序?qū)⒅辽偕婕皟膳_聯(lián)網(wǎng)的機器(當然在開發(fā)過程中完全有可能有一臺機器扮演客戶端和服務器角色)。鑒于這一事實,機器必須確定一個特定的有線協(xié)議,以確定如何發(fā)送和接收數(shù)據(jù)。線路協(xié)議,關(guān)系到計算機的問題是超文本傳遞協(xié)議(HTTP)。當客戶機啟動一個(

26、如Netscape Navigator,Mozilla Firefox瀏覽器,或Microsoft Internet Explorer)瀏覽器,一個HTTP請求訪問(如*. aspx或*. htm文件)在遠程服務器上的特定資源。 HTTP是一個基于文本的協(xié)議,是建立在一個標準的請求/響應式。例如,如果導航到http:/www.IntertechT,瀏覽器軟件利用網(wǎng)絡技術(shù)網(wǎng)域名稱服務(DNS)轉(zhuǎn)換成由四個部分組成,32位數(shù)值(又名IP地址)注冊的網(wǎng)址。此時,瀏覽器打開一個(通常是通過端口80)套接字連接和發(fā)送的默認HTTP網(wǎng)頁上http:/www.IntertechTrai

27、要求。一旦托管的Web服務器接收 發(fā)送來的HTTP請求,指定的資源可能包含邏輯輸入值(例如在一個文本框的值),以便以適當?shù)母袷交貜虷TTP響應。 Web程序員可以利用任何技術(shù)(共同閘道介面,的ASP,ASP.NET,Java Servlets和等)來動態(tài)生成納入HTTP響應的內(nèi)容。此時,客戶端的HTML瀏覽器從Web服務器發(fā)出的請求。網(wǎng)絡的另一個顯著的發(fā)展是從傳統(tǒng)的桌面程序變成HTTP的無國界有線協(xié)議。只要服務器發(fā)出響應客戶,所有關(guān)于以前的交互作用被遺忘了。因此,作為Web開發(fā)人員,它是由你采取具體步驟,以“記住”信息(如在購物車中的物品)有關(guān)目前誰登錄到您的站點。你會在下一章

28、看到,ASP.NET提供了許多方法來處理狀態(tài),其中許多是很常見網(wǎng)絡平臺(會話變量,Cookie和應用程序變量)以及一些新技術(shù)(視圖狀態(tài),控制狀態(tài),和緩存)。了解Web應用程序和Web服務器一個web應用程序可以被理解為一個檔案集合(*.熱媒,*. asp和*.的ASPX,圖像文件等)和(如相關(guān)的組件。NET代碼庫)在一組特定的目錄中存儲給定的Web服務器。如第24章所示,Web應用程序有一個特定的生命周期,并提供了許多活動(如初始啟動或最后關(guān)閉),可以連接到。Web服務器是 接管網(wǎng)絡應用的軟件產(chǎn)品,而且通常提供集成安全等一系列相關(guān)服務的數(shù)量,文件傳輸協(xié)議(FTP)的支持,郵件交換服務,等等。互

29、聯(lián)網(wǎng)信息服務(IIS)是微軟的企業(yè)級Web服務器的產(chǎn)品,它內(nèi)在的支持傳統(tǒng)的ASP以及ASP.NET Web應用程序。當你建立ASP.NET Web應用程序,你會經(jīng)常需要與IIS進行交互。請注意,IIS是不會自動選擇安裝Windows Server 2003或Windows XP專業(yè)版(無法安裝在Windows家用版IIS)的。因此,在你的開發(fā)機器配置不同時,您可能需要手動安裝本章所說的IIS程序。為此,只需訪問添加/從控制面板文件夾刪除程序小程序并選擇添加/刪除Windows組件。工作與IIS虛擬目錄在每一個虛擬目錄里單一的IIS有能力辦好許多Web應用程序。每一個虛擬目錄映射到本地硬盤驅(qū)動器

30、的物理目錄。因此,如果您創(chuàng)建一個新的虛擬目錄名為CarsRUs,外界可以瀏覽到這個網(wǎng)站使用的網(wǎng)址,如http:/www.CarsRU(假設您的網(wǎng)站的IP地址已經(jīng)與整個世界的登記)。在內(nèi)部,該虛擬目錄映射到一個物理根目錄,如C: inetpub wwwroot的 AspNetCarsSite,其中包含Web應用程序的內(nèi)容。當您創(chuàng)建ASP.NET Web應用程序使用Visual Studio 2005,您可以產(chǎn)生一個新的當前網(wǎng)站的虛擬目錄選項。不過,你也可以手動創(chuàng)建一個虛擬目錄。為了說明起見,假設你想創(chuàng)建一個簡單的Web應用程序命名為汽車。第一步是創(chuàng)建一個你新文件夾以保存文件,構(gòu)成新的網(wǎng)

31、站(例如,C: CodeTests CarsWebSite)集合。下面,需要創(chuàng)建一個新的虛擬目錄舉辦汽車的網(wǎng)站。只需右鍵單擊默認Web站點的IIS節(jié)點,然后從上下文菜單中選擇New虛擬目錄。此菜單選擇啟動一個綜合向?qū)?。跳過過去的歡迎屏幕,是你的網(wǎng)站的名稱(汽車)。接下來,您被要求指定您的硬盤驅(qū)動器包含各種文件和圖像的物理文件夾代表本網(wǎng)站(在此情況下,C: CodeTests CarsWebSite)。在向?qū)У淖詈笠徊綍崾灸阈碌奶摂M目錄(如讀/寫訪問的文件它包含了一些基本特征你,能夠從一個網(wǎng)頁瀏覽器這些文件,能夠發(fā)射可執(zhí)行文件例如,共同閘道介面應用等)。在這個例子中,只是默認選擇(注意,您可以

32、隨時修改運行此工具后,使用不同的用鼠標右鍵單擊屬性對話框在IIS集成箱您的選擇)。 原文2The Role of the Global.asax FileAt this point, an ASP.NET application may seem to be little more than a set of *.aspx files and their respective web controls. While you could build a web application by simply linking a set of related web pages, you will m

33、ost likely need a way to interact with the web application as a whole. To this end, your ASP.NET web applications may choose to include an optional Global.asax file via the WebSite.Add New Item menu option.Simply put, Global.asax is just about as close to a traditional double-clickable *.exe that we

34、 can get in the world of ASP.NET, meaning this type represents the runtime behavior of the website itself. Once you insert a Global.asax file into a web project, you will notice it is little more than a block containing a set of event handlers:void Application_Start(Object sender, EventArgs e)/ Code

35、 that runs on application startupvoid Application_End(Object sender, EventArgs e)/ Code that runs on application shutdownvoid Application_Error(Object sender, EventArgs e)/ Code that runs when an unhandled error occursvoid Session_Start(Object sender, EventArgs e)/ Code that runs when a new session

36、is startedvoid Session_End(Object sender, EventArgs e)/ Code that runs when a session endsLooks can be deceiving, however. At runtime, the code within this block is assembled into a class type deriving from System.Web.HttpApplication. If you have a background in ASP.NET 1.x, you may recall that the

37、Global.asax code-behind file literally did define a class deriving from HttpApplication.The Global Last Chance Exception Event Handler First, let me point out the role of the Application_Error() event handler. Recall that a specific page may handle the Error event to process any unhandled exception

38、that occurred within the scope of the page itself. In a similar light, the Application_Error() event handler is the final place to handle an exception that was not handled by a specific page. As with the page-level Error event, you are able to access the specific System.Exception using the inherited

39、 Server property: void Application_Error(Object sender, EventArgs e)Exception ex = Server.GetLastError();Response.Write(ex.Message);Server.ClearError();Given that the Application_Error() event handler is the last chance exception handler for your web application, odds are that you would rather not r

40、eport the error to the user, but you would like to log this information to the web servers event log, for example:.void Application_Error(Object sender, EventArgs e)/ Log last error to event log.Exception ex = Server.GetLastError();EventLog ev = new EventLog(Application);ev.WriteEntry(ex.Message, Ev

41、entLogEntryType.Error);Server.ClearError();Response.Write(This app has bombed. Sorry!);The HttpApplication Base Class As mentioned, the Global.asax script is dynamically generated into a class deriving from the System.Web.HttpApplication base class, which supplies the same sort of functionality as t

42、he System.Web.UI.Page type.Application This property allows you to interact with application-level variables, using the exposed HttpApplicationState type.Request This property allows you to interact with the incoming HTTP request (via HttpRequest).Response This property allows you to interact with t

43、he incoming HTTP response (via HttpResponse).Server This property gets the intrinsic server object for the current request (via HttpServerUtility).Session This property allows you to interact with session-level variables, using the exposed HttpSessionState type.譯文2作者:P.S.Yu, H.Heiss, and D.M.Dias國籍:

44、德國出處:ASP.NET 2.0 Web Pages and Web ControlsGlobal.asax文件的作用ASP.NET應用程序看起來是一個*. aspx文件中各自的網(wǎng)絡控制設置。雖然可以通過建立起來的相關(guān)網(wǎng)頁設置一個Web應用程序,你很可能需要一種整個互動的Web應用程序。為此,ASP.NET Web應用程序可以通過選擇一個可選的Global.asax網(wǎng)站添加新項菜單選項文件。簡單地說,Global.asax是一種類似于傳統(tǒng)的double-clickable *.exe文件,在ASP.NET世界,這意味著這種類型的網(wǎng)站代表了本身運行時的行為。一旦你插入的一個Global.asax文件轉(zhuǎn)換成一個網(wǎng)頁專題研究,你會發(fā)現(xiàn)它是包含一組事件處理器:void Application_Start(Object sender, EventArgs e)/ Code that runs on application startupvo

溫馨提示

  • 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. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論