⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 article.txt

📁 ASP切分器
💻 TXT
字号:
CAspParser - An ASP Parser using MFC.

CAspParser is a very basic ASP script parsing class written in MFC. The classes are part of my Baby Web Server, which implements a very simple Web Server.
When writing these classes I was inspired by an article from MSDN Magazine 'A Client-side Environment for ASP Pages ' by Dino Esposito.
Although I didn't use any of the code from the MSDN article (mainly because it was written in VB) it was very helpful to get me started. 
One problem with Dino's solution is, that it is using the msscript.ocx (Microsoft Script Control), which is not available on all Windows system (you must download and install it separately from Internet Explorer).

In this article I present you a MFC solution that uses Microsoft's Scripting Engine COM interface.
The ASP parser has 4 classes:

CScriptEngine
This is a wrapper class around the COM interface of Microsoft's Scripting Engine. It simply converts all calls to the COM interface to easy to use MFC functions.

CResponseObject
This class provides the IResponse interface to the scripting engine.
The IReponse is used by ASP to write data from a script to the output HTML page.

CRequestObject
This class provides the IRequest interface to the scripting engine.
The IRequest is used by ASP to read data from various collections into the script.
The following collections are (partly) implemented:

QueryString Collection: used to get URL parameters.
Form Collection: used to get Form variables.
Server Variables Collection: used to get server information (local or remote ip address, server name and much more).
Cookies Collection: used to get data from cookies.


CAspParser
This class implements the ASP parser. It attaches the interfaces to the script engine and prepares the ASP page for execution.
First all HTML code is converted to ASP code (Response.Write lines), so the resulting page contains only ASP code.
The Script Engine then executes this code and all output is written to the Response buffer.
Any calls to Reponse or Request objects will be routed to my CReponseObject and CRequestObject classes.
In the case of a web server this response buffer will be send back to the web browser.

TODO:
This is only the beginning of an ASP parser and a lot of work needs to be done to make it really useful in a web server.
When I continue to develop my web server I will update this article along the way.

If you have any improvements, additions or suggestions please let me know.


Copyright 2003 Pablo Software Solutions
http://www.pablovandermeer.nl


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -