ini文件读写
//创建对象:
iniFile:=TIniFile.Create(strFile);
//写入
procedure IEAddFavUrl(FURL, Title: string);
var
fPath: string;
begin
fPath := GetFavoritesPath;
with TIniFile.Create(fPath + Title + '.url') do
try
WriteString('InternetShortcut', 'URL', FURL);
finally
free;
end;
end;
//读取单个子节点的值
function AWS_GET_HomeWebAddr:String;
var
strPath,strDefault,strWebAddr:string;
AWSIni:TIniFile;
Buffer:array[0..MAX_PATH] of Char;
begin
strDefault:='http://'+GStack.LocalAddress;
ZeroMemory(@Buffer[0],SizeOf(Buffer));
GetWindowsDirectory(@Buffer[0],MAX_PATH);
strPath:=StrPas(@Buffer[0])+'\Aws.ini';
AWSIni:=TIniFile.Create(strPath);
strWebAddr:=AWSIni.ReadString('config','Aws_LocalIp','');
AWSIni.Free;
if strWebAddr='' then
strWebAddr:=strDefault;
Result:=strWebAddr;
end;
//读取整个节点下的值和字节点名称
strFile:=StrBackupPath+'data.ini';
iniFile:=TIniFile.Create(strFile);
sl:=TStringList.Create;
slValue:=TStringList.Create;
iniFile.ReadSections(sl);//读取ini文件中所有的一级节点到sl中。
iniFile.ReadSection('comm',sl);//读取comm节点下所有子节点名称到sl中.
iniFile.ReadSectionValues('comm',slValue);//读取comm节点下所有子节点的名称和值到slValue中:id=123
ini文件读写的更多相关文章
- [IO] C# INI文件读写类与源码下载 (转载)
/// <summary> /// 类说明:INI文件读写类. /// 编 码 人:苏飞 /// 联系方式:361983679 /// 更新网站:[url]http://www.sufei ...
- QSettings配置读写-win注册表操作-ini文件读写
版权声明:若无来源注明,Techie亮博客文章均为原创. 转载请以链接形式标明本文标题和地址: 本文标题:QSettings配置读写-win注册表操作-ini文件读写 本文地址:http:// ...
- C#对INI文件读写
C#本身没有对INI格式文件的操作类,可以自定义一个IniFile类进行INI文件读写. using System; using System.Collections.Generic; using S ...
- 封装 INI 文件读写函数
delphi读写ini文件实例 //--两个过程,主要实现:窗体关闭的时候,文件保存界面信息:窗体创建的时候,程序读取文件文件保存的信息. //--首先要uses IniFiles(单元) //--窗 ...
- C#实现.ini文件读写操作
1.ini文件是什么? 见百度百科:https://baike.baidu.com/item/ini%E6%96%87%E4%BB%B6/9718973?fr=aladdin 2.C#语 ...
- VC++ 实现INI文件读写操作
转载:https://blog.csdn.net/fan380485838/article/details/73188420 在实际项目开发中,会用ini配置文件,在此总结一下对ini读写操作 一:读 ...
- ini文件读写 保存上次存储内容
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...
- Delphi ini文件读写
参考:http://www.cnblogs.com/zhangzhifeng/archive/2011/12/01/2270267.html 一.ini文件的结构 ;这是关于 ini 文件的注释 [节 ...
- C# INI文件读写类
public class Ini { // 声明INI文件的写操作函数 WritePrivateProfileString() [System.Runtime.InteropServices.DllI ...
随机推荐
- Google file system
读完了Google file system论文的中文版,记录一下总结,懒得打字,直接上草图:
- JS中的Map和Set实现映射对象
使用iterable内置的forEach方法 var a = ['A', 'B', 'C']; a.forEach(function (element, index, array) { // elem ...
- Ubuntu 卸载重装 IntelliJ Idea Community
参考: https://stackoverflow.com/questions/22983101/how-to-uninstall-intellij-idea-on-ubuntu-13-10 @SLH ...
- oracle数据泵笔记
1.创建目录 查询已有目录:select * from dba_directories 创建并授权: CREATE DIRECTORY dump_dir AS '/tmp/' grant read,w ...
- Go Revel - Modules(模块)
revel中的模块是一个可以插入到应用中的包, 它允许从第三方引入至应用,并在它和应用之间共享控制器.视图与资源等数据. 一个模块应当具有和revel应用相同的结构."主"程序会以 ...
- Ubuntu 中的VI和vim
转载出处:http://blog.csdn.net/xiajun07061225/article/details/7039413 或功能键[Home]:移动到这一行的最前面字符处. $或功能键[End ...
- SSH远程连接Linux配置
CentOS: 开启远程连接服务:service sshd start 添加到系统启动项:chkconfig sshd on 客户端工具:windows下连接工具putty ========= ...
- Hbase学习笔记——基本CRUD操作
进入Hbase的安装目录,启动Hbase bin/start-hbase.sh 打开shell命令行模式 bin/hbase shell 关闭Hbase bin/stop-hbase.sh 一个cel ...
- 【转帖】oracle数据类型和对应的java类型
原文地址:http://otndnld.oracle.co.jp/document/products/oracle10g/102/doc_cd/java.102/B19275-03/datacc.ht ...
- 同样的so,放到不同的project中,就会报错
网上看到的帖子,笔记一下 最近在看蓝斯的一篇文章基于Platinum库的DMS实现(android) 把其中的so文件直接拷贝到了另外一个project中,jin文件也一样,唯一不同的是包名. 运行报 ...