1. 主 程 序:
// ISAPI1.CPP - Implementation file for your Internet Server
#include "stdafx.h"
#include "isapi1.h"
///////////////////////////////////////////////////////////////////////
// The one and only CWinApp object
// NOTE: You may remove this object if you alter your project to no
// longer use MFC in a DLL.
CWinApp theApp;
///////////////////////////////////////////////////////////////////////
// command-parsing map
BEGIN_PARSE_MAP(CIsapi1Extension, CHttpServer)
/************* My codes begin here ***********/
ON_PARSE_COMMAND(RegisterUser,
CIsapi1Extension, ITS_PSTR ITS_PSTR ITS_PSTR)
ON_PARSE_COMMAND_PARAMS("First Middle Last")
/************* My codes end here ***********/
END_PARSE_MAP(CIsapi1Extension)
///////////////////////////////////////////////////////////////////////
// The one and only CIsapi1Extension object
///////////////////////////////////////////////////////////////////////
// CIsapi1Extension command handlers
/****** My code begins here**********/
void CIsapi1Extension::RegisterUser
( CHttpServerContext* pctxt, LPCTSTR
pstrFirst, LPCTSTR pstrMiddle, LPCTSTR pstrLast )
{
// do processing here!
*pctxt << _T("Your name is:");
*pctxt << _T(pstrFirst);
*pctxt << _T("\n");
*pctxt << _T("Your Address is:");
*pctxt << _T(pstrMiddle);
*pctxt << _T("\n");
*pctxt << _T("Your E_mail is:");
*pctxt << _T(pstrLast);
}
/********* My codes end here **********/
// Do not edit the following lines,
which are needed by ClassWizard.
#if 0
BEGIN_MESSAGE_MAP(CIsapi1Extension, CHttpServer)
//{{AFX_MSG_MAP(CIsapi1Extension)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
#endif// 0
2. 主 头 文 件
// ISAPI1.H - Header file for your Internet Server
//isapi1 Extension
#include "resource.h"
class CIsapi1Extension : public CHttpServer
{
public:
CIsapi1Extension();
~CIsapi1Extension();
// Overrides
// ClassWizard generated virtual function overrides
// NOTE - the ClassWizard will add and remove member functions here.
//DO NOT EDIT what you see in these blocks of generated code !
//{{AFX_VIRTUAL(CIsapi1Extension)
public:
virtual BOOL GetExtensionVersion(HSE_VERSION_INFO* pVer);
//}}AFX_VIRTUAL
// TODO: Add handlers for your commands here.
/*********** My coded begin here ( 函 数 声 明) *********/
void RegisterUser( CHttpServerContext* pctxt,
LPCTSTR pstrFirst, LPCTSTR
pstrMiddle, LPCTSTR pstrLast );
/*********My codes end here
DECLARE_PARSE_MAP()