代码拉取完成,页面将自动刷新
unit fmmain;
interface
uses
SvcMgr,Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdBaseComponent, IdComponent, IdTCPServer, IdCustomHTTPServer,
IdHTTPServer, StdCtrls,SiMath, GUIStatus,SimNTService, Menus,simpipe,
IdIOHandlerSocket, ExePluginSys,PluginSys, jpeg, {SimSplash,} ComCtrls,//libfcgi2,
DateUtils,ExtCtrls,CGIUpload,SimHTTPServer;
type
Tfrmmain = class(TForm)
idhtpsrvr1: TIdHTTPServer;
lbl1: TLabel;
txtport: TEdit;
btstart: TButton;
btnstop: TButton;
btn1: TButton;
chkAutoStart: TCheckBox;
mm1: TMainMenu;
N1: TMenuItem;
N2: TMenuItem;
N3: TMenuItem;
php1: TMenuItem;
N4: TMenuItem;
N5: TMenuItem;
N6: TMenuItem;
N7: TMenuItem;
btnInstall: TButton;
btnUninstall: TButton;
stat1: TStatusBar;
N8: TMenuItem;
N9: TMenuItem;
N10: TMenuItem;
mmo1: TMemo;
spl1: TSplitter;
procedure btstartClick(Sender: TObject);
procedure btnstopClick(Sender: TObject);
procedure idhtpsrvr1CommandGet(AThread: TIdPeerThread;
ARequestInfo: TIdHTTPRequestInfo;
AResponseInfo: TIdHTTPResponseInfo);
procedure FormCreate(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure btn1Click(Sender: TObject);
procedure N4Click(Sender: TObject);
procedure N5Click(Sender: TObject);
procedure N6Click(Sender: TObject);
procedure N3Click(Sender: TObject);
procedure php1Click(Sender: TObject);
procedure N7Click(Sender: TObject);
procedure btnInstallClick(Sender: TObject);
procedure btnUninstallClick(Sender: TObject);
procedure ExePluginStrRead(sender:TObject;astr:string);
procedure N9Click(Sender: TObject);
procedure idhtpsrvr1CreatePostStream(ASender: TIdPeerThread;
var VPostStream: TStream);
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
GUIStatus1: TGUIStatus;
SimNTService1: TSimNTService;
{smsplsh1: TSimSplash;}
upload:Tcgiupload;
ssGMT:TStringList;
exeplugin:TExePluginSys;
function translatePath(avpath:string;var redir:Boolean):string;
function checkExt(aext:string):boolean;
procedure doCommand(acmd:string);
protected
public
{ Public declarations }
FHTMLDir:string;
FCGIDir:string;
PHPDir:string;
TMPDir:string;
function getMIMEType(aExt:string):string;
end;
var
frmmain: Tfrmmain;
CriticalSection : TRTLCriticalSection;//定义临界区
implementation
uses
fmVirtualPath,fmExtend,fmDefaultFile;
{$R *.dfm}
procedure Tfrmmain.btstartClick(Sender: TObject);
begin
try
self.idhtpsrvr1.Bindings.Items[0].Port:=StrToInt(self.txtport.Text);
self.idhtpsrvr1.Active:=true;
self.btstart.Enabled:=False;
except
if Pos('install',LowerCase(ParamStr(1)))>1 then
begin
end else
ShowMessage('服务已经运行或端口被占用,请先到服务管理器中停止服务或更换端口!');
end;
SetEnvironmentVariable('SERVER_PORT',PChar(IntToStr(self.idhtpsrvr1.Bindings.Items[0].Port)));
SetEnvironmentVariable('SERVER_ADDR',PChar(self.idhtpsrvr1.Bindings.Items[0].IP));
SetEnvironmentVariable('DOCUMENT_ROOT',PChar(FHTMLDir));
SetEnvironmentVariable('GATEWAY_INTERFACE','CGI/1.1');
SetEnvironmentVariable('SERVER_PROTOCOL','HTTP/1.1');
SetEnvironmentVariable('REDIRECT_STATUS','200');
SetEnvironmentVariable('SERVER_SOFTWARE','SimWebServer/1.3'); //AResponseInfo.ServerSoftware 显示为idy9.0
end;
procedure Tfrmmain.btnstopClick(Sender: TObject);
begin
self.idhtpsrvr1.Active:=false;
self.btstart.Enabled:=true;
end;
procedure Tfrmmain.idhtpsrvr1CommandGet(AThread: TIdPeerThread;
ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
var
s,sExt,sHead:string;
i,j,k,l:Integer;
LFilename: string;
LPathname: string;
pc:array[0..255] of Char;
ms:TMemoryStream;
bredir:Boolean;
ss:arString;
sl:TStringList;
begin
EnterCriticalSection(CriticalSection);//进入临界区
//FillChar(pc,SizeOf(pc),#0);
//windows.GetEnvironmentVariable('SCRIPT_NAME',pc,256);
//s:=ARequestInfo.Command; //请求时get 或 post
//ARequestInfo.FormParams //post的参数
{if self.mmo1.Lines.Count>500 then self.mmo1.Clear;
self.mmo1.Lines.Add(format('Command %s %s received from %s:%d',
[aRequestInfo.Command, aRequestInfo.Document,
TIdIOHandlerSocket(AThread.Connection.IOHandler).Binding.PeerIP,
TIdIOHandlerSocket(AThread.Connection.IOHandler).Binding.PeerPort])); }
LFilename := ARequestInfo.Document;
AResponseInfo.Server:='simwebserver/6.0'; {IIS/6.0}
AResponseInfo.CacheControl:='no-cache';
AResponseInfo.Pragma:='no-cache';
SetEnvironmentVariable('SCRIPT_NAME',PChar(LFilename));
SetEnvironmentVariable('PATH_INFO',PChar(LFilename));
LPathname:=self.translatePath(lfilename,bredir);
if bredir then
begin
AResponseInfo.Redirect(lfilename+'/');
LeaveCriticalSection(CriticalSection); //离开临界区
exit;
end;
{ARequestInfo.Session.Lock; //必须开2个session属性和设置时间idhttpserver的session才能生效
ARequestInfo.Session.Content.Values['SCRIPT_PATH']:=ExtractFilePath(LPathname);
ARequestInfo.Session.Unlock; }
//s:=ARequestInfo.RawHeaders.Text;
SetEnvironmentVariable('HTTP_COOKIE',PChar(ARequestInfo.RawHeaders.Values['Cookie']));
SetEnvironmentVariable('QUERY_STRING',PChar(ARequestInfo.QueryParams));
SetEnvironmentVariable('HTTP_HOST',PChar(ARequestInfo.Host+':'+inttostr(idhtpsrvr1.Bindings.Items[0].Port)));
SetEnvironmentVariable('SERVER_NAME',PChar(ARequestInfo.Host)); // AResponseInfo.Server 显示为idy9.0
SetEnvironmentVariable('HTTP_REFERER',PChar(ARequestInfo.Referer));
SetEnvironmentVariable('AUTH_TYPE',{PChar(ARequestInfo.Authentication.AuthParams.Text)}'BASIC');
SetEnvironmentVariable('REMOTE_ADDR',PChar(ARequestInfo.RemoteIP));
SetEnvironmentVariable('HTTP_USER_AGENT',PChar(ARequestInfo.UserAgent));
SetEnvironmentVariable('HTTP_CONNECTION',PChar(ARequestInfo.Connection));
SetEnvironmentVariable('HTTP_ACCEPT_ENCODING',PChar(ARequestInfo.AcceptEncoding));
SetEnvironmentVariable('HTTP_ACCEPT_LANGUAGE',PChar(ARequestInfo.AcceptLanguage));
SetEnvironmentVariable('HTTP_ACCEPT',PChar(ARequestInfo.Accept));
SetEnvironmentVariable('REQUEST_METHOD',PChar(ARequestInfo.command));
SetEnvironmentVariable('CONTENT_TYPE',PChar(ARequestInfo.ContentType));
SetEnvironmentVariable('CONTENT_LENGTH',PChar(IntToStr(ARequestInfo.ContentLength)));
i:=pos('.exe',LowerCase(LPathname));
s:='.exe';
k:=frmextend.simgrid1.RowCount-1;
j:=1;
while (i<1) and (j<=k) do
begin
s:=LowerCase(Trim(frmextend.simgrid1.Cells[0,j]));
i:=Pos(s,LowerCase(LPathname));
Inc(j);
end;
if i>0 then
begin
l:=Length(s);
s:=Copy(LPathname,i+l,Length(LPathname)-i-l+1);
LPathname:=Copy(LPathname,1,i-1+l);
s:=StringReplace(s,'\','/',[rfReplaceAll]);
if s='/' then s:='';
SetEnvironmentVariable('PATH_INFO',PChar(s));
end;
SetEnvironmentVariable('PATH_TRANSLATED',PChar(LPathname));
SetEnvironmentVariable('SCRIPT_FILENAME',PChar(LPathname));
if FileExists(LPathname) then
begin
{set cache values} //<meta http-equiv="Cache-control" content="public">
sext:=ExtractFileExt(LPathname);
AResponseInfo.ContentType:=ARequestInfo.RawHeaders.Values['Content-Type'];
AResponseInfo.ContentType:=self.getMIMEType(sExt); //获取MIME;
if (sExt='.exe') or (sExt='') or (sExt='.cgi') then
begin
//runPipeCreateprocess(LPathname,s);
with TSimPipe.Create(nil) do
begin
if ARequestInfo.Command='POST' then
begin
runApp(LPathname,true);
end else
begin
runApp(LPathname,False);
end;
if ARequestInfo.ContentLength>0 then
begin
s:=ARequestInfo.FormParams;
if s='' then
begin
SetLength(s, ARequestInfo.PostStream.Size);
ARequestInfo.PostStream.Position:=0;
ARequestInfo.PostStream.Read(s[1], ARequestInfo.PostStream.Size);
end;
if s<>'' then
begin
//upload.AnalyFormData(s);
writeLine(s);
end;
end;
s:='';
readLine(s);
free;
end;
if s='' then
begin
LeaveCriticalSection(CriticalSection); //离开临界区
exit;
end;
i:=Pos(#$D#$A#$D#$A,s);
if i>0 then
begin
shead:=Copy(s,1,i+1);
//AResponseInfo.RawHeaders.Text:=shead; //没作用
AResponseInfo.CustomHeaders.Text:=sHead;
i:=i+length(sext);
s:=Copy(s,i,Length(s)-i+1);
end;
AResponseInfo.ContentText:=s;
i:=Pos('Status:',sHead);
if i>0 then
begin
AResponseInfo.ResponseNo:=strtoint(Copy(sHead,i+8,3));
end;
AResponseInfo.ContentType:=AResponseInfo.CustomHeaders.Values['Content-Type'];
AResponseInfo.Location:=AResponseInfo.CustomHeaders.Values['location'];
{ms:=TMemoryStream.Create;
ms.LoadFromStream(TStringStream.Create(s));
AResponseInfo.ContentStream:=ms; }
LeaveCriticalSection(CriticalSection); //离开临界区
exit;
end else if Self.checkExt(sExt) then
begin
//SetEnvironmentVariable('PATH_INFO',PChar(LFilename));
//runPipeCreateprocess(PHPDir+' -c '+extractfilepath(phpdir)+'php.ini -f '+LPathname,s);
with TSimPipe.Create(nil) do
begin
//C:\python\python.exe ”%s”%s 这样的被解析
s:=Format(PHPDir,[LPathname,LPathname]);
if ARequestInfo.Command='POST' then
begin
runApp(s,true,'',ExtractDir(PHPDir));
end else
begin
runApp(s,False,'',ExtractDir(PHPDir));
end;
if ARequestInfo.ContentLength>0 then
begin
s:=ARequestInfo.FormParams;
writeLine(s);
end;
s:='';
readLine(s);
free;
end;
if s='' then
begin
LeaveCriticalSection(CriticalSection); //离开临界区
exit;
end;
i:=Pos(#$D#$A#$D#$A,s);
if i>0 then
begin
shead:=Copy(s,1,i+1);
i:=i+4;
AResponseInfo.CustomHeaders.Text:=sHead;
s:=Copy(s,i,Length(s)-i+1);
end;
AResponseInfo.ContentText:=s;
i:=Pos('Status:',sHead);
if i>0 then
begin
AResponseInfo.ResponseNo:=strtoint(Copy(sHead,i+8,3));
end;
AResponseInfo.ContentType:=AResponseInfo.CustomHeaders.Values['Content-Type'];
AResponseInfo.Location:=AResponseInfo.CustomHeaders.Values['location'];
LeaveCriticalSection(CriticalSection); //离开临界区
exit;
end;
{sl:=tstringlist.Create;
sl.Text:=ARequestInfo.UnparsedParams;
sl.SaveToFile('header.txt');
sl.Free;}
s:=ARequestInfo.RawHeaders.Values['If-Modified-Since'];
//i:=Pos('If-Modified-Since:',s);
if s<>'' then
begin
//s:=Copy(s,i+18+5,Length(s)-i-17-5);
j:=Length(s);
s:=Copy(s,5,j-4);
ss:=Split(s,' ');
ss[1]:=ssGMT.Values[ss[1]];
ARequestInfo.LastModified:=SiMath.formatStrToDate(ss[2]+'-'+ss[1]+'-'+ss[0]+' '+ss[3]);
end;
AResponseInfo.CacheControl := 'Cache-Control: max-age=360000, must-revalidate';
AResponseInfo.Expires := IncDay(Date, 31);
AResponseInfo.LastModified := SiMath.formatStrToDate(simath.GetFileTime(LPathname,gfModifyTime));
AResponseInfo.Date:=Now;
if (AResponseInfo.LastModified<=ARequestInfo.LastModified) then
begin
AResponseInfo.ResponseNo:=304;
LeaveCriticalSection(CriticalSection); //离开临界区
exit;
end;
AResponseInfo.ContentStream := TFileStream.Create(LPathname, fmOpenRead + fmShareDenyWrite);
end else begin
AResponseInfo.ResponseNo := 404;
s:='<html><head><title>404文件未找到</title><meta content="text/html; charset=UTF-8" http-equiv="content-type"></head><body><a href="http://www.kapple.cn" target=_blank>The requested URL ' + ARequestInfo.Document+ ' was not found on this server. 点击进入 www.kapple.cn,访问作品网站</body></html>';
AResponseInfo.ContentText := Utf8encode(s);
//AResponseInfo.Redirect('http://www.kapple.cn');
end;
//AThread.Connection.Disconnect;
LeaveCriticalSection(CriticalSection); //离开临界区
end;
procedure Tfrmmain.FormCreate(Sender: TObject);
var
s,sp:string;
i,l:integer;
begin
GUIStatus1:=TGUIStatus.Create(self);
SimNTService1:=TSimNTService.Create(self);
//smsplsh1:= TSimSplash.Create(self);
//smsplsh1.SoftName:='伽罗web服务器';
//self.smsplsh1.init;
InitializeCriticalSection(CriticalSection); //初始化临界区
frmVPath:=TfrmVPath.Create(Application);
self.GUIStatus1.Add(frmVPath.simgrid1);
frmDftFile:=TfrmDftFile.Create(Application);
self.GUIStatus1.Add(frmDftFile.mmo1);
frmExtend:=TfrmExtend.Create(Application);
self.GUIStatus1.Add(frmExtend.simgrid1);
self.GUIStatus1.Add(self.txtport);
self.GUIStatus1.Add(self.chkAutoStart);
self.GUIStatus1.LoadFromFile();
FHTMLDir:= SiMath.GetLocal(frmVPath.simgrid1.Cells[1,1]); //ExtractFilePath(Application.ExeName)+ 'wwwroot';
//simath.makeDir(FHTMLDir);
FCGIDir:= SiMath.GetLocal( 'cgi');
simath.makeDir(FCGIDir);
PHPDir:=SiMath.GetLocal('php5.3.28/php-cgi.exe');
TMPDir:='c:\tmp';
makeDir(TMPDir);
makeDir(GetLocal('plugin'));
self.exeplugin:=TExePluginSys.Create(self);
self.exeplugin.dir:='plugin';
self.exeplugin.Menu:=N8;
self.exeplugin.OnPluginStrRead:=self.ExePluginStrRead;
{s:=SiMath.GetLocal('asp/reg.bat');
sp:=simath.ExtractDir(s);
SiMath.BlockWinExec(PChar(s),SW_HIDE,PChar(sp));}
l:=frmExtend.simgrid1.RowCount;
for i:=1 to l-1 do
begin
if LowerCase(frmExtend.simgrid1.Cells[0,i])='.asp' then
begin
s:=ExtractFilePath(GetLocal(frmExtend.simgrid1.Cells[1,i]));
TPluginSys.RegCom(s+'\setacl.ocx');
TPluginSys.RegCom(s+'\slasp3.dll');
TPluginSys.RegCom(s+'\sldispatch.dll');
Break;
end;
end;
ssGMT:=TStringList.Create;
with ssGMT do
begin
CommaText :='Jan=1,Feb=2,Mar=3,Apr=4,May=5,Jun=6,Jul=7,Aug=8,Sep=9,Oct=10,Nov=11,Dec=12';
end;
upload:=Tcgiupload.Create(nil);
if Self.chkAutoStart.Checked then self.btstartClick(self);
end;
procedure Tfrmmain.FormClose(Sender: TObject; var Action: TCloseAction);
begin
self.idhtpsrvr1.Active:=false;
self.GUIStatus1.SaveToFile();
self.exeplugin.Free;
ssGMT.Free;
upload.free;
end;
procedure Tfrmmain.btn1Click(Sender: TObject);
var
s:string;
ws:WideString;
begin
//SiMath.iterateDir('plugin',s,'*.*');
//ShowMessage(s);
//exit;
//SiMath.BlockWinExec(PChar(PHPDir));
ShowMessage(floatToStr(now-date));exit;
with TSimPipe.Create(nil) do
begin
runApp('plugindev/project1.exe');
ws:='testcc';
writeLine(ws);
readLine(s);
//s:=ws;
free;
end;
ShowMessage(s);
end;
procedure Tfrmmain.N4Click(Sender: TObject);
begin
SiMath.simShell('http://www.kapple.cn');
end;
procedure Tfrmmain.N5Click(Sender: TObject);
begin
//self.smsplsh1.ShowDlg;
end;
procedure Tfrmmain.N6Click(Sender: TObject);
begin
ShowMessage('QQ:35769382');
end;
procedure Tfrmmain.N3Click(Sender: TObject);
begin
frmVPath.Show;
end;
procedure Tfrmmain.php1Click(Sender: TObject);
begin
frmExtend.Show;
end;
function Tfrmmain.translatePath(avpath: string;var redir:Boolean): string;
function tryDefaultFile(apath:string):string;
var
i,l:integer;
s:string;
begin
l:=frmDftFile.mmo1.Lines.Count;
for i:=0 to l-1 do
begin
s:=apath+'\'+trim(frmDftFile.mmo1.Lines[i]);
s:=StringReplace(s,'\\','\',[rfReplaceAll]);
if FileExists(s) then
begin
result:=s;
exit;
end;
end;
result:=s;
end;
var
i,j,l:integer;
s,sf,sp,spfirst,splast:string;
label
bg,exit1;
begin
redir:=false;
bg:
s:=SiMath.ExtractDir(avpath);
s:=LowerCase(s);
i:=Pos('/',s);
if i>0 then
begin
spfirst:=Copy(s,1,i-1);
splast:=copy(s,i+1,Length(s)-i);
end else
begin
spfirst:=s;
splast:='';
end;
if spfirst='' then
spfirst:='/';
sf:=simath.ExtractFile(avpath);
l:=frmVPath.simgrid1.RowCount;
for i:=1 to l-1 do
begin
if frmVPath.simgrid1.Cells[0,i]=spfirst then
begin
sp:=SiMath.GetLocal(frmVPath.simgrid1.Cells[1,i])+'\'+splast;
if sf='' then
s:=tryDefaultFile(sp)
else
s:=sp+'\'+sf;
s:=StringReplace(s,'/','\',[rfReplaceAll]);
s:=stringreplace(s,'\\','\',[rfReplaceAll]);
if DirectoryExists(s) then
begin
result:=tryDefaultFile(s);
redir:=true;
goto exit1;
end;
result:=s;
goto exit1;
end;
end;
if sf='' then
result:=tryDefaultFile(self.FHTMLDir+'\'+ExtractDir(avpath))
else
result:=self.FHTMLDir+avpath;
exit1:
if (not FileExists(result)) and (ExtractFileExt(result)='') then
begin
i:=pos('.exe\',result);
if i>1 then
begin
//result:=Copy(Result,1,i+3);
end else
begin
avpath:=avpath+'/';
redir:=true;
goto bg;
end;
end;
Result:=StringReplace(Result,'/','\',[rfReplaceAll]);
Result:=stringreplace(Result,'\\','\',[rfReplaceAll]);
end;
procedure Tfrmmain.N7Click(Sender: TObject);
begin
frmDftFile.Show;
end;
function Tfrmmain.getMIMEType(aExt: string): string;
var
s,mmtxt,mmimg,mmvideo:string;
i,l:Integer;
begin
s:=LowerCase(aExt);
l:=frmExtend.simgrid1.RowCount;
mmtxt:='.htm.html.txt.vbs.js.css.xml.exe.dll.cgi.aspx';
for i:=1 to l-1 do
begin
mmtxt:=mmtxt+frmextend.simgrid1.Cells[0,i];
end;
mmimg:='.jpg.jpeg.png.gif.bmp';
mmvideo:='.mpeg.mpg.avi.rm.flv';
if (pos(s,mmtxt)>0) or (s='') then
begin
s:=StringReplace(s,'.','',[rfReplaceAll]);
if s='js' then s:='javascript';
if s='htm' then s:='html';
result:='text/'+s;
end else if pos(s,mmimg)>0 then
begin
s:=StringReplace(s,'.','',[rfReplaceAll]);
result:='image/'+s;
end else if pos(s,mmvideo)>0 then
begin
s:=StringReplace(s,'.','',[rfReplaceAll]);
result:='video/'+s;
end else
begin
result:='application/octet-stream';
end;
end;
procedure Tfrmmain.btnInstallClick(Sender: TObject);
begin
SiMath.creatProc(Application.ExeName+' -install');
end;
procedure Tfrmmain.btnUninstallClick(Sender: TObject);
begin
SiMath.creatProc(Application.ExeName+' -uninstall');
end;
function Tfrmmain.checkExt(aext: string): boolean;
var
i,l:integer;
begin
result:=false;
l:=frmExtend.simgrid1.RowCount;
for i:=1 to l-1 do
begin
if LowerCase(Trim(frmExtend.simgrid1.Cells[0,i]))=aext then
begin
self.PHPDir:=GetLocal(frmExtend.simgrid1.Cells[1,i]);
result:=true;
exit;
end;
end;
end;
procedure Tfrmmain.ExePluginStrRead(sender: TObject; astr: string);
var
ss:TStringList;
i,l:integer;
begin
//ShowMessage(astr);
ss:=TStringList.Create;
ss.Text:=astr;
l:=ss.Count;
for i:=0 to l-1 do
begin
if Trim(ss.Strings[i])='' then Continue;
doCommand(ss.Strings[i]);
end;
ss.Free;
end;
procedure Tfrmmain.doCommand(acmd: string);
var
ss:arString;
i,l:integer;
begin
ss:=Split(LowerCase(Trim(acmd)),',');
if ss[0]='addvpath' then
begin
l:=frmVPath.simgrid1.RowCount;
for i:=1 to l-1 do
begin
if ss[1]=frmVPath.simgrid1.Cells[0,i] then
begin
frmVPath.simgrid1.Cells[1,i]:=SS[2];
if Length(ss)>3 then
frmVPath.simgrid1.Cells[2,i]:=SS[3];
Exit;
end;
end;
l:=frmVPath.simgrid1.RowCount;
frmVPath.simgrid1.RowCount:=l +1;
frmVPath.simgrid1.Cells[0,l]:=SS[1];
frmVPath.simgrid1.Cells[1,l]:=SS[2];
if Length(ss)>3 then
frmVPath.simgrid1.Cells[2,l]:=SS[3];
end else if ss[0]='adddeffile' then
begin
l:=frmDftFile.mmo1.Lines.Count;
for i:=0 to l-1 do
begin
if ss[1]=frmDftFile.mmo1.Lines.Strings[i] then
begin
Exit;
end;
end;
frmDftFile.mmo1.Lines.Add(SS[1]);
end else if ss[0]='addext' then
begin
l:=frmExtend.simgrid1.RowCount;
for i:=1 to l-1 do
begin
if ss[1]=frmExtend.simgrid1.Cells[0,i] then
begin
frmExtend.simgrid1.Cells[1,i]:=SS[2];
Exit;
end;
end;
l:=frmExtend.simgrid1.RowCount;
frmExtend.simgrid1.RowCount:=l +1;
frmExtend.simgrid1.Cells[0,l]:=SS[1];
frmExtend.simgrid1.Cells[1,l]:=SS[2];
end;
end;
procedure Tfrmmain.N9Click(Sender: TObject);
begin
ShowMessage('在您的exe中只要执行writeln(Delphi)或cout,print(c/c++)输入类似如下的文本,即可改变母体配置'+
#13#10'addVPath,phpadmin,phpadmin,www.kapple.cn'#13#10+
'addDefFile,default.htm'#13#10+
'addExt,.py,ext/python/python.exe "%s" %s');
end;
procedure Tfrmmain.idhtpsrvr1CreatePostStream(ASender: TIdPeerThread;
var VPostStream: TStream);
begin
//VPostStream := TMemoryStream.Create;
end;
procedure Tfrmmain.FormDestroy(Sender: TObject);
begin
DeleteCriticalSection(CriticalSection); //删除临界区
end;
initialization
TSimNTService.init('KaWebServer','SimHttpSvr',frmmain);
end.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。