计算机专业文献翻译--功能强大的asp-html转换工具-jsp程序(编辑修改稿)内容摘要:
at instance of the scriptControl recognizes Response as a keyword and uses to work with it. It39。 s a very mon technique in scripting. Incidentally, this is the same technique that allows IIS to inject the true ASP object model in the scripting context of a serverside ASP page. This workaround also makes it possible for Windows script Host (WSH) scripts to rely on a systemprovided Wscript object. Call in Action When the browser39。 s main form is ready to parse and display the ASP code, it calls the ParseTextToFile method, which takes two file names: the source ASP file and the target HTML file. When the method returns successfully, the form simply navigates to the newly created local HTML page. The full source code of the CAspParser class is shown in Figure 4. Let39。 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。 % blocks. All the text outside of these markers is written to the Response object. It accumulates the text into an internal string buffer that emulates the stream where the real ASP Response object writes. In this way, the simulated Response object caches all the output, just as the real ASP Response does when buffering is on. Note that under IIS buffering is on by default, while it was turned off by default in earlier versions of IIS. In Figure 4, the method is used to clear any buffered text that you accumulated through repeated calls to . This Clear method plays exactly the same role it does in the real ASP object model you39。 re used to on the server. Now let39。 s have a closer look at the implementation of the simulated ASP Response object. To further illustrate the language neutrality of COM and to avoid the problem of writing objects in Visual Basic with the same method names as some language keywords (such as Write or End), I decided to write the MyASP objects using ATL and Visual C++? The implementation of the object is straightforward (see Figure 5). The MyASP objects need to expose methods with signatures that match the way you39。 re using them in your clientside ASP pages. If you39。 re using the clientside ASP engine to work on specific clientonly pages, then there39。 s no particular reason for you to use a custom object that mimics the ASP39。 s Response. You are better off writing a pletely custom object with the programming interface you prefer. The need to mimic the signatures of ASP intrinsic objects arises when you39。 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。 s ready for return to the caller. This behavior mimics exactly what the ASP Response object does internally when buffering is on. The Clear method empties the buffer. MyASP also implements a property called ResponseBuffer that returns the current content of the output buffer. This property works in much the same way as the ASP Flush method. Each time you read it, its contents are cleared. IIS itself manages to send the transformed text to the browser via HTTP. Consequently, there39。 s no need to make the internal buffer available to the scripts in the ASP page. In fact, the ASP Response object doesn39。 t have a method or property (such as ResponseBuffer) that returns the text accumulated in the internal buffer. In this clientside emulation, the browser needs to get the transformed text from the object, and a property is more helpful than a subroutine like Flush. Finally, the End method sets an internal variable to false. This variable is exposed through the CanContinue property and is used to stop the loop that governs the parsing of the ASP text. As you can see, the programming interface of the object is similar161。 170。 but not identical to161。 170。 the ASP Response object. The logic behind the two objects is shared to some extent, but it clearly differs as the working context of the client and serverside editions of Response requires. In Figure 6 you can see that both the custom browser and Inter Explorer render my simple page in the same way. If you open Explorer in the folder that contains the specified ASP page and doubleclick the item, in most cases Visual InterDev?will open because it is the program that is usually registered to edit ASP files. If you want to be able to doubleclick on ASP files and see their content, you could associate them with a program like Visual InterDev. However, remember that a generic ASP page might be using objects like Session or Application that the clientside parser doesn39。 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。 re confused by the truncated output in the HTML textbox, don39。 t be too concerned. Try viewing the same document through Inter Explorer and HTTP and you39。 ll see that the HTML the browser receives from the Web server is exactly the。计算机专业文献翻译--功能强大的asp-html转换工具-jsp程序(编辑修改稿)
相关推荐
s 0 and 128 bytes of RAM starting at address 128. ROM stands for readonly memory. A ROM chip is programmed with a permanent collection of preset bytes. The address bus tells the ROM chip which byte
he market the work game operation experience, the Chinese work game starts to march into the stable mature development. Majority of occupies the main status in today the work game business agents all
turn make request to the other resources. Access to resources will be granted or denied based on the identity that is being impersonated. 2 Authentication in ASP. NET Authentication is one of the
山庄商业计划书 岳西龙井山庄商业计划书 一、项目背景 随着现代人们生活水平的不断提高,休闲旅游业迅速发展起来,人们越来越追求健康的休闲生活方式,到优美的自然环境中去,赏山玩水,吸天然氧吧,舒缓因工作、生活给现代人带来的压力,放松心情,充分的享受大自然给人们带来的美好感受。 同时生态旅游项目是发掘资源、利用资源优势的健康产业、朝阳产业,前景广阔。 龙井湖开发,峡谷与湖面山水相连
with the rest of the Java system. Vendors are encouraged to write an API that is more strongly typed than ODBC, which affords greater static typechecking at pile time. Here39。 s a description of the
he use Corresponding author. Tel.:+ 912332301327。 fax: +912332300831. Email addresses: (. Raste), (. Kulkarn i). 10848045/$ see front matter r 2020 Published by Elsevier Ltd. doi: 2 of IPv4overIPv6