//创建对象:
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

最新文章

  1. 【转】iOS9适配
  2. Two Sum (c#)
  3. UVa 714 Copying Books(二分)
  4. IOS第15天(2,事件处理,侧滑菜单,抽屉效果)
  5. Spring----->projects----->概述
  6. 电话连线(codevs 1003)
  7. IOS 改变导航栏返回按钮的标题
  8. 30个HTML5学习资源
  9. 关于socket的关闭:close和shutdown
  10. MVC5入门学习系列④
  11. Oracle的sessions和processes的数计算公式
  12. Android 开发笔记___存储方式__共享参数__sharedprefences
  13. 【转】Linux上vi(vim)编辑器使用教程
  14. c#核心基础 - 浅谈 c# 中的特性 Attribute)
  15. H5 文本属性
  16. 150. Evaluate Reverse Polish Notation逆波兰表达式
  17. [UE4]虚幻4蓝图使用小技巧
  18. linux下brctl配置网桥
  19. HDU 2243 考研路茫茫——单词情结(AC自动机+矩阵快速幂)
  20. 获取不到offsetHeight问题

热门文章

  1. 模仿CountDownLatch类自定义倒时计时器
  2. Git 删除操作
  3. 关于Solaris 的磁盘的分区
  4. mysql 第二高薪水
  5. c++ union内存
  6. 官方文档:Office VBA 参考
  7. ModelAttribue注解的使用
  8. H - An Easy Problem?!
  9. jquery <img> 图片懒加载 和 标签如果没有加载出图片或没有图片,就显示默认的图片
  10. CentOS开机自启动/etc/rc.local不执行的解决办法