我想再注册表里判断一个值,比如在HKEY_LOCAL_MACHINE\SoftWare\Microsoft下我想判断是否有项m里的zc字符串,zc的值是1
如果都满足系统启动,不满足系统就 Application.Terminate;
谢谢大家了,请给出代码,谢谢,拜托了
如果都满足系统启动,不满足系统就 Application.Terminate;
谢谢大家了,请给出代码,谢谢,拜托了
解决方案 »
- delphi如何将dbgrideh数据导出到excel的不同工作表
- fastreport主从表关系设置
- 在delphi中,如何在Tmemo控件中,设置某一行的颜色? 急!!
- VCL的基类是什么?编写控件的基类又是什么?可视化控件的基类又是什么?
- 请求解决的小问题?
- 用DELPHI写托盘效果的程序,如何弹出那个黄色背景的汽泡式信息对话框?
- 关于日历控件——马上结贴
- 请问各位有没有在delphi中用vb的mscomm开发过什么东西的,能给点心路历程吗?小弟现在毕业设计有用到这东西啊!
- 怎么样调事整Treelist的line的长度
- if (adotable1['ram']>'2002-05-09') then ...:ram为时间日期型这样是否成立.该如何处理机.
- 有什么函数能查找listview中的column并返回该column的index?
- 求一SQL,Sql Server数据库!
var
Tr:Tregistry;
begin
Tr:=Tregistry.Create;
if Tr.OpenKey('HKEY_LOCAL_MACHINE\SoftWare\Microsoft\m',false) then
begin
if Tr.ReadString('zc')='1' then
begin
showmessage('ok');
Tr.Free;
end
else
application.Terminate;
end
else
application.Terminate;end;
procedure TForm1.Button1Click(Sender: TObject);
var
Tr:Tregistry;
begin
Tr:=Tregistry.Create;
try
if not Tr.OpenKey('HKEY_LOCAL_MACHINE\SoftWare\Microsoft\m',false) then
application.terminate
else
begin if Tr.ReadString('zc')='1' then
showmessage('ok')
else
application.terminate;
end
finally
Tr.free;
end;
end;
var
Reg:TRegistry;
n:string;
a: integer;
begin
Reg:=TRegistry.Create;
Try
Reg.RootKey:=HKEY_LOCAL_MACHINE;
if Reg.OpenKey('\SoftWare\Microsoft\'+'m',true) then
begin
n:=Reg.ReadString('zc');
try
a := strtoint(n) ;
except
a := 0;
end;
if a <> 1 then
begin
Application.Terminate;
end
end;
finally
Reg.CloseKey;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
Tr:Tregistry;
begin
Tr:=Tregistry.Create;
try
if not Tr.OpenKey('HKEY_LOCAL_MACHINE\SoftWare\Microsoft\m',false) then
application.terminate
else
begin if Tr.ReadString('zc')='1' then
showmessage('ok')
else
application.terminate;
end
finally
begin
Tr.CloseKey;
Tr.free;
end;
end;
end;