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

📄 cgilg.cpp

📁 网络编程的一些实例
💻 CPP
字号:
//---------------------------------------------------------------------------
#include "cgilg.h"
//---------------------------------------------------------------------------
#include <fstream>
#pragma package(smart_init)
#pragma resource "*.dfm"
TWebModule1 *WebModule1;
//---------------------------------------------------------------------------
__fastcall TWebModule1::TWebModule1(TComponent* Owner)
	: TWebModule(Owner)
{
}
//---------------------------------------------------------------------------
__fastcall TWebModule1::~TWebModule1()
{
}
//---------------------------------------------------------------------------
void __fastcall TWebModule1::WebModule1WebActionItem2Action(
      TObject *Sender, TWebRequest *Request, TWebResponse *Response,
      bool &Handled)
{
  Response->Content = PageProducer2->Content();
}
//---------------------------------------------------------------------------
void __fastcall TWebModule1::DataSetTableProducer1FormatCell(
      TObject *Sender, int CellRow, int CellColumn, THTMLBgColor &BgColor,
      THTMLAlign &Align, THTMLVAlign &VAlign, AnsiString &CustomAttrs,
      AnsiString &CellData)
{
  if (CellData == "(MEMO)")
    {
     CellData = Table1Notes->AsString;
    }
}
//---------------------------------------------------------------------------
void __fastcall TWebModule1::PageProducer1HTMLTag(TObject *Sender,
      TTag Tag, const AnsiString TagString, TStrings *TagParams,
      AnsiString &ReplaceText)
{
  if(TagString == "BIOTABLE")
    {
     ReplaceText = DataSetTableProducer1->Content();
    }
}
//---------------------------------------------------------------------------
void __fastcall TWebModule1::WebModule1WebActionItem1Action(
      TObject *Sender, TWebRequest *Request, TWebResponse *Response,
      bool &Handled)
{
  Response->Content = PageProducer1->Content();
}
//---------------------------------------------------------------------------

void __fastcall TWebModule1::PageProducer2HTMLTag(TObject *Sender,
      TTag Tag, const AnsiString TagString, TStrings *TagParams,
      AnsiString &ReplaceText)
{
  if(TagString == "COUNTRYTABLE")
    {
     ReplaceText = QueryTableProducer1->Content();
    }
}
//---------------------------------------------------------------------------

void __fastcall TWebModule1::WebModule1DefaultActionItemAction(
      TObject *Sender, TWebRequest *Request, TWebResponse *Response,
      bool &Handled)
{
  Response->Content = "<html><head><title>出错</title></head><body>使用 /biolife 或者 /Country </body></html>";
}
//---------------------------------------------------------------------------

⌨️ 快捷键说明

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