【正文】
d objects with a particular user. A tool to store individual settings and resources can solve the problem. This is what the Session and Application objects provide, albeit at different levels. But you don39。s article, Active scripting with Perlscript, in the August 1999 issue of MIND, explores the use of Perl with ASP. When it es to using the scriptControl you need to do three things: set up the language, add as many objects as you want to the script namespace, and execute the script code. In my special edition browser, I set the language to VBscript during the form load event. At the same time, I create instances of all the objects I want to be visible to the script engine at runtime. Named items visible to the parser at runtime is a concept that warrants further explanation. The whole set of named items forms the script39。s see how it works step by step on a very simple ASP page: html body % X=1 % % Hello, world! % hr The value of X is %= X% /body /html The CAspParser class initializes the script control by setting the script language to VBscript (this is not strictly necessary since the scriptControl already defaults to it), and adding a brand new instance of the object to the namespace. The control then passes to the method ParseTextToFile. It receives the name of the ASP file, verifies it has an ASP extension, and reads in all of its content. I used the for clarity only (see Figure 4). Using the CreateFile API or other I/O technique could give you better performance. The string with all the ASP content is then parsed for %161。re writing dual pages to be used on the Web as well as locally on a CD. When you invoke the Write method on , the text you pass in is added to an internal member variable that39。t support. Figure 6 The Custom Browser versus Inter Explorer?? Consider a page like the following, which is nearly identical to the previous one except for a statement. html body % x=1 % % Hello, world! % hr % % The value of X is %= x% /body /html Figure 7 shows that the End method correctly stops the processing. If you39。s go back to the page in Figure 8, which imports a Cascading Style Sheets (CSS) file: link rel=stylesheet href= The file name is not a URL and does not contain path information. This means that both IIS and the ASP offline browser will look for it in the current folder, where the hosting ASP page resides. You can also specify a fully qualified path name for the CSS and it will work fine as well. What happens if the page contains hyperlinks? If the anchor tag points to an existing absolute URL, then everything will work normally as the browsing engine simply navigates to the specified location. If the hyperlink refers to a relative URL that does not contain the protocolthen two things happen. First, the browser attempts to locate the specified page in the current location. If the page with the link is c:\pages\, then is assumed to be in c:\pages. An HTTP 404 error is returned if it isn39。s nothing predefined this module can do. Win32?based browsers usually look in the registry for the application registered to open ASP files. Often this application is Visual InterDev. Figure 11 Web Browser Navigation?? To follow a link to an ASP page in a clientside ASP environment, you need a customized browser. The ASP browser utilizes the WebBrowser control to display the page. The ponent traps all clicks on hyperlink tags and processes them the usual way, through the Inter Explorer standard navigation module. You need to prevent the standard browser39。 一臺(tái) ASP 變換器的實(shí)際的 原因 沒(méi)問(wèn)題,因此一臺(tái) ASP 對(duì) HTML 的變換器可能不是數(shù)千個(gè)程序員每天晚上夢(mèng)想的工具。 為什么再造列 舉被請(qǐng)求,什么時(shí)候一靜止的 HTML 頁(yè)招致得較少的高速旋轉(zhuǎn) 在頭頂嗎? 一件 ASP 對(duì) HTML 的工具能為 ASP 頁(yè)被用作一種批編譯器。 ASP 為工程的 Web 邊看起來(lái)象自然的選擇,但是 CD 怎么樣? 做 ASP 沒(méi)有 Web 服務(wù)器,你工作脫機(jī)需要編碼選出全部 %...%從頁(yè)的碼組 并且處理他們。 瀏覽器的角色 為了努力趕上在工作時(shí)脫機(jī)的 ASP,你需要來(lái)自瀏覽器的一點(diǎn)幫助。 作為在 C++里的一個(gè)好起點(diǎn),你能試驗(yàn) MFCIE或者 ATLBrowser 樣品,其中兩者都 用最新的平臺(tái) SDK 來(lái)。 通過(guò) SetscriptControl,種類收到工作的實(shí)例 書(shū)寫(xiě)環(huán)境 (更多關(guān)于后的這 )。 命令正文被選出和 分別處理。 儲(chǔ)存?zhèn)€人的一件工具 底座和資源能解決問(wèn)題。 基于我的個(gè)人經(jīng)驗(yàn),我建議,你實(shí)現(xiàn)一最小 套特征 (類似于我在這里討論的那些 )和延長(zhǎng)確定什么時(shí)候你的頁(yè)需要支持 額外的 ASP 特征。 入門以來(lái),看這極端 C++ 柱子在內(nèi)的 1997 年 8月刊 微軟公司因特網(wǎng) 開(kāi)發(fā)者。 在我的號(hào)外瀏覽器,我里 把語(yǔ)言確定成 VBscript 在形式期間裝事件。 更好,接口的那些 scriptControl(以及 Windows 書(shū)寫(xiě)編程 接口 )允許你以非常方便方式做這。 這變通辦法也使 Windows 書(shū)寫(xiě)得以 主人 (WSH)手稿依賴一個(gè)系統(tǒng)提供的Wscript 對(duì)象。 使用 CreateFile API 或者其他I/O 技術(shù)能給你更好的性能。 現(xiàn)在讓我們更進(jìn)一不看一下 ASP 反應(yīng)物體的實(shí)施。 在 4 圖, 方法習(xí)慣于整整你積累通過(guò)的任何緩沖的正文 重復(fù)呼叫到 。 它 收到 ASP 文件的名字,證實(shí)它有一次 ASP 擴(kuò)展,并且在它的所有內(nèi)容里讀。 一普通技術(shù)在方面 寫(xiě)稿。 在 (象 MsgBox 那樣 )的每個(gè)名字后面有可編程序?qū)嶓w是否它是 A 具體語(yǔ)法分析程序的功能或者一個(gè)一定加工過(guò)程中的 COM 物體的方法。 托拜厄斯Martinsson 文章, 活躍的寫(xiě)稿用 Perlscript, 在心的 1999 年 8 月刊里,用ASP 探索使用 Perl。 關(guān)鍵問(wèn)題關(guān)系到你怎樣模擬反應(yīng)或者請(qǐng)求目標(biāo)和你怎樣運(yùn)行全部書(shū)寫(xiě) 一個(gè) ASP 文件包含的代碼。 雖然 ASP 被緊緊地和 IIS 和微軟公司事項(xiàng)服務(wù) (山 ),以及 COM+結(jié)合起來(lái) 環(huán)境,這沒(méi)意味著你使用不能一統(tǒng)一,然而基于 ASP 對(duì)于最一致的來(lái)說(shuō)接近 交付滿足通過(guò)不同的媒介 (象 Web 和 CD 一樣 )的產(chǎn)品的發(fā)展。 一 ASP 目標(biāo)模型客戶 問(wèn)題與 Web 應(yīng)用一起一保持的不能說(shuō)明工作越過(guò) HTTP。173。 全部邏輯被隱藏在 CAspParser 種類里,這暴露 3 個(gè)公眾功能: 預(yù)置, SetscriptControl 和 ParseTextToFile。 在再細(xì)分類 IE 或者 Netscape 時(shí) 通信員總可能,我建議你從頭開(kāi)始使用現(xiàn)有的 Web 寫(xiě)一個(gè)嶄新的瀏覽器 象微軟公司W(wǎng)ebBrowser 那樣的瀏覽器技術(shù)控制。 這個(gè)月的代碼顯示 這種潛能的這方法并且典型 ASP 頁(yè)與合作,雖然不綜合。 例如,一 客戶最近關(guān)于為都建造使用一種單個(gè)的發(fā)展環(huán)境的可能性問(wèn)我 網(wǎng)站和 CD?我首先考慮使用可能在 Web 上方或者在 A 里被觀看的靜止的 HTML 頁(yè) 地方瀏覽器,想法不久開(kāi)除給復(fù)雜性和有關(guān)內(nèi)容的數(shù)量。 不過(guò),如果數(shù)據(jù)庫(kù)不非常易變并且頁(yè)產(chǎn)量不是 非常依賴用戶的輸入,你能容易為更好的性能憑借明白的老的 HTML。 當(dāng)你雙擊一 HTML 頁(yè)時(shí) 從探險(xiǎn)者殼中,你僅僅要瀏覽器挽回并且給予文件的源碼。m building here. Figure 11 explains the typical browser39。s use the clientside parser to work with a more plex ASP page that involves databases. Figure 8 shows an ASP page that fills and displays a table with a few records taken from an OLE DB data source. Despite the use of ActiveX Data Objects (ADO), the structure of the page is relatively simple. To make this example more realistic I would need to implement the Request object and the simulation of the POST and the GET HTTP mands. I39。170。s no particular reason for you to use a custom object that mimics the ASP39