hello.h

来自「Vc.Net入门与提高源码」· C头文件 代码 · 共 44 行

H
44
字号
// Hello.h
//
// This is a part of the Active Template Library.
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
// This source code is only intended as a supplement to the
// Active Template Library Reference and related
// electronic documentation provided with the library.
// See these sources for detailed information regarding the
// Active Template Library product.

// Hello.h : Defines the ATL Server request handler class
//
#pragma once

[ request_handler("Default") ]
class CHelloHandler
{
private:
	// Put private members here

protected:
	// Put protected members here

public:
	// Put public members here

	HTTP_CODE ValidateAndExchange()
	{
		// Set the content-type
		m_HttpResponse.SetContentType("text/html");

		// check for form submission
		CStringA strUser(m_HttpRequest.QueryParams.Lookup("user"));

		CStringA strPage;
		strPage.Format("<html><body>Hello %s!</body></html>", strUser);

		m_HttpResponse << strPage;

		return HTTP_SUCCESS;
	}
}; // class CHelloHandler

⌨️ 快捷键说明

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