调用系统关机
uses Comobj;
var
shellapp: variant;
begin
shellapp := CreateOleObject('Shell.Application');
shellapp.ShutDownWindows;
end;
shellapp: variant;
begin
shellapp := CreateOleObject('Shell.Application');
shellapp.ShutDownWindows;
end;
调用系统关于对话框
uses shellapi;
shellabout(Handle,'系统信息','ACCESS小助手 版权所有 TECSOON WENDAY',0);
shellabout(Handle,'系统信息','ACCESS小助手 版权所有 TECSOON WENDAY',Application.Icon.Handle);
//计算器
winexec('calc.exe',sw_normal);
取系统IP地址
USES Sockets;
var
tp:ttcpclient;
strname,straddr:string;
begin
tp:=ttcpclient.create(self);
tp.close;
tp.open;
strname:=tp.LocalHostName;
straddr:=tp.LocalHostAddr;
tp:ttcpclient;
strname,straddr:string;
begin
tp:=ttcpclient.create(self);
tp.close;
tp.open;
strname:=tp.LocalHostName;
straddr:=tp.LocalHostAddr;
Edit1.Text:=strname+' IP: '+straddr;
tp.close;
end;
end;
转大小写
UpperCase(str)
LowerCase(str)
退出确认
procedure Tf_main.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
if messagedlg('您真的要退出吗?',mtconfirmation,[mbYes,MbNo],0)=idNo then
canclose:=false;
end;
begin
if messagedlg('您真的要退出吗?',mtconfirmation,[mbYes,MbNo],0)=idNo then
canclose:=false;
end;