我要修改一注册表的键值,路径已经确定:
(既修改,一IP地址的最后一个值)
(既修改,一IP地址的最后一个值)
解决方案 »
- 请教 DELPHI7.0 问题
- delphi调用这个存储过程老是返回空集,在查询分析器调用则能返回数据集
- 大家给一个delphi7.0的下载地址给我哦
- 编译能通过,但调试时出错,请问这 是什么原因呢?我是初学者,请各位大师指点,急,谢谢!
- 这段代码错在哪了[改变任务栏上的"开始"按钮的文本]
- 客户端机器连接Sql Server为什么出错?而服务器执行该程序却没有问题。附代码:
- 如何能在退出程序的时候退认?
- 我的MM有问题,请帮忙解决!
- 询问事务处理?
- yangfan请进,咱聊聊!
- 100分:求Report Machine 完全版(不是免费版)!!!
- ■■■各位给我儿子取个名字吧?进者有分。姓孟,二字,三字均可。最好有“梦”的谐音,没有也可。谢了。
RegIniFile:=TRegIniFile.Create('Software');Writes a string value to a specified data value associated with a specified key.procedure WriteString(const Section, Ident, Value: string);DescriptionCall WriteString to store a string value in a data value associated with a specified key.Section is a string identifying the key into which to store a data value. Ident is a string identifying the name of the data value into which to write. Value is the string value to write into the data value.例子
var RegIniFile:TRegIniFile;
try
RegIniFile.WriteString(SECTION,'LOGIN_CODE',g_sUserCode);
RegIniFile.WriteInteger(SECTION,'Height',Self.Height);
RegIniFile.WriteInteger(SECTION,'Width',Self.Width);
RegIniFile.WriteInteger(SECTION,'Left',Self.Left);
RegIniFile.WriteInteger(SECTION,'Top',Self.Top);
finally
RegIniFile.Free;
end;
SECTION 是个变量
Delphi Help:
The following example shows how to tell Windows to relaunch your application when Windows starts up if it was running when the system shut down. When Windows starts up, it launches each application listed in the RunOnce key and then deletes the entry for that application. Therefore, you do not need to remove the entry written here.procedure TForm1.WMEndSession(var Message: TWMEndSession);
var
Reg: TRegistry;
begin
Reg := TRegistry.Create;
try
Reg.RootKey := HKEY_CURRENT_USER;
if Reg.OpenKey('\Software\Microsoft\Windows\CurrentVersion\RunOnce', True)
then Reg.WriteString('MyApp','"' + ParamStr(0) + '"');
finally
Reg.CloseKey;
Reg.Free;
inherited;
end;
end;In order for this method to be called, it must be declared in the interface section of your unit as follows:private procedure WMEndSession(var Msg:TWMEndSession); message WM_ENDSESSION;
RegF:TRegistry;
begin
RegF:=TRegistry.Create;
RegF.OpenKey("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Class\NetTrans\0001",TRUE);
RegF.WriteString("IPAddress",IP);
end;IP就是你要改的IP地址了