// ISAPISAMPLE.CPP - Implementation file for your Internet Server
// ISAPISample Extension
#include "stdafx.h"
#include "ISAPISample.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(CISAPISampleExtension, CHttpServer)
// TODO: insert your ON_PARSE_COMMAND() and
// ON_PARSE_COMMAND_PARAMS() here to hook up your commands.
// For example:
//ON_PARSE_COMMAND(Default, CISAPISampleExtension, ITS_EMPTY)
DEFAULT_PARSE_COMMAND(Default, CISAPISampleExtension)
ON_PARSE_COMMAND(ConfirmOrder,CISAPISampleExtension,ITS_PSTR)
ON_PARSE_COMMAND_PARAMS("name")
ON_PARSE_COMMAND(OrderForm,CISAPISampleExtension,ITS_PSTR
ITS_PSTR ITS_I4 ITS_PSTR ITS_PSTR ITS_PSTR ITS_PSTR ITS_PSTR)
ON_PARSE_COMMAND_PARAMS("name address quantity time check1=~ check2=~ check3=~ check4=~")
END_PARSE_MAP(CISAPISampleExtension)
///////////////////////////////////////////////////////////////////////
// The one and only CISAPISampleExtension object
CISAPISampleExtension theExtension;
///////////////////////////////////////////////////////////////////////
// CISAPISampleExtension implementation
CISAPISampleExtension::CISAPISampleExtension()
{
}
CISAPISampleExtension::~CISAPISampleExtension()
{
}
BOOL CISAPISampleExtension::GetExtensionVersion(HSE_VERSION_INFO* pVer)
{
// Call default implementation for initialization
CHttpServer::GetExtensionVersion(pVer);
// Load description string
TCHAR sz[HSE_MAX_EXT_DLL_NAME_LEN+1];
ISAPIVERIFY(::LoadString(AfxGetResourceHandle(),
IDS_SERVER, sz, HSE_MAX_EXT_DLL_NAME_LEN));
_tcscpy(pVer->lpszExtensionDesc, sz);
return TRUE;
}
BOOL CISAPISampleExtension::TerminateExtension(DWORD dwFlags)
{
// extension is being terminated
//TODO: Clean up any per-instance resources
return TRUE;
}
///////////////////////////////////////////////////////////////////////
// CISAPISampleExtension command handlers
void CISAPISampleExtension::Default(CHttpServerContext* pCtxt)
{
StartContent(pCtxt);
WriteTitle(pCtxt);
*pCtxt << _T("This default message was produced by the Internet");
*pCtxt << _T(" Server DLL Wizard. Edit your CISAPISampleExtension::Default()");
*pCtxt << _T(" implementation to change it.\r\n");
EndContent(pCtxt);
}
// Do not edit the following lines, which are needed by ClassWizard.
#if 0
BEGIN_MESSAGE_MAP(CISAPISampleExtension, CHttpServer)
//{{AFX_MSG_MAP(CISAPISampleExtension)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
#endif // 0
void CISAPISampleExtension::OrderForm(CHttpServerContext* pCtxt,
LPCTSTR pstrName,LPCTSTR pstrAddr,int nQuantity,
LPCTSTR pstrTime,LPCTSTR pstrCheck1,
LPCTSTR pstrCheck2,LPCTSTR pstrCheck3,LPCTSTR pstrCheck4)
{
StartContent(pCtxt);
WriteTitle(pCtxt);
if((strlen(pstrName)>0)&&(strlen(pstrAddr)>0))
{
*pCtxt<<"<h1>订单信息确认:</h1>";
*pCtxt<<"<p>姓名:"<<pstrName<<"</p>";
*pCtxt<<"<p>地址:"<<pstrAddr<<"</p>";
*pCtxt<<"<p>数量:"<<(long int)nQuantity<<"</p>";
*pCtxt<<"<p>送货时间:"<<pstrTime<<"</p>";
*pCtxt<<"<p>附加服务:"<<pstrCheck1<<" "<<pstrCheck2<<" "<<pstrCheck3<<" "<<pstrCheck4<<"</p>";
*pCtxt<<"<p><input type=\"hidden\" name=\"name\" value=\""<<pstrName<<"\"></p>";
*pCtxt<<"<p><center><input type=\"submit\" value=\"确认\"></center></p>";
*pCtxt<<"</form>";
}
else
{
*pCtxt<<"<p>请输入姓名和地址信息!</p>";
}
EndContent(pCtxt);
}
void CISAPISampleExtension::ConfirmOrder(CHttpServerContext* pCtxt,LPCTSTR pstrName)
{
StartContent(pCtxt);
WriteTitle(pCtxt);
*pCtxt<<"<h1>定购成功</h1>";
*pCtxt<<"<p>您选购的货物将在一天以内送到</p>";
*pCtxt<<"<p>"<<pstrName<<",欢迎下次再来!</p>";
EndContent(pCtxt);
}
///////////////////////////////////////////////////////////////////////
// If your extension will not use MFC, you'll need this code to make
// sure the extension objects can find the resource handle for the
// module. If you convert your extension to not be dependent on MFC,
// remove the comments arounn the following AfxGetResourceHandle()
// and DllMain() functions, as well as the g_hInstance global.
/****
static HINSTANCE g_hInstance;
HINSTANCE AFXISAPI AfxGetResourceHandle()
{
return g_hInstance;
}
BOOL WINAPI DllMain(HINSTANCE hInst, ULONG ulReason,
LPVOID lpReserved)
{
if (ulReason == DLL_PROCESS_ATTACH)
{
g_hInstance = hInst;
}
return TRUE;
}
****/
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
ISAPI服务器扩展程序.rar (16个子文件)
ISAPI服务器扩展程序
ISAPISample
ISAPISample.ncb 57KB
OrderForm.htm 1KB
Resource.h 320B
ISAPISample.plg 932B
ISAPISample.clw 408B
ISAPISample.dsw 547B
ISAPISample.cpp 5KB
ISAPISample.opt 53KB
ISAPISample.rc2 403B
StdAfx.cpp 213B
ISAPISample.rc 3KB
ISAPISample.def 169B
StdAfx.h 669B
ISAPISample.h 1KB
Debug
ISAPISample.dsp 4KB
www.pudn.com.txt 218B
共 16 条
- 1
资源评论
寒泊
- 粉丝: 75
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功