//创建对象:
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文件读写的更多相关文章

  1. [IO] C# INI文件读写类与源码下载 (转载)

    /// <summary> /// 类说明:INI文件读写类. /// 编 码 人:苏飞 /// 联系方式:361983679 /// 更新网站:[url]http://www.sufei ...

  2. QSettings配置读写-win注册表操作-ini文件读写

    版权声明:若无来源注明,Techie亮博客文章均为原创. 转载请以链接形式标明本文标题和地址: 本文标题:QSettings配置读写-win注册表操作-ini文件读写     本文地址:http:// ...

  3. C#对INI文件读写

    C#本身没有对INI格式文件的操作类,可以自定义一个IniFile类进行INI文件读写. using System; using System.Collections.Generic; using S ...

  4. 封装 INI 文件读写函数

    delphi读写ini文件实例 //--两个过程,主要实现:窗体关闭的时候,文件保存界面信息:窗体创建的时候,程序读取文件文件保存的信息. //--首先要uses IniFiles(单元) //--窗 ...

  5. C#实现.ini文件读写操作

    1.ini文件是什么?        见百度百科:https://baike.baidu.com/item/ini%E6%96%87%E4%BB%B6/9718973?fr=aladdin 2.C#语 ...

  6. VC++ 实现INI文件读写操作

    转载:https://blog.csdn.net/fan380485838/article/details/73188420 在实际项目开发中,会用ini配置文件,在此总结一下对ini读写操作 一:读 ...

  7. ini文件读写 保存上次存储内容

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...

  8. Delphi ini文件读写

    参考:http://www.cnblogs.com/zhangzhifeng/archive/2011/12/01/2270267.html 一.ini文件的结构 ;这是关于 ini 文件的注释 [节 ...

  9. C# INI文件读写类

    public class Ini { // 声明INI文件的写操作函数 WritePrivateProfileString() [System.Runtime.InteropServices.DllI ...

随机推荐

  1. oracle 回收表空间的数据文件大小

    查看表空间的使用情况: " "used MB",b.bytes "free MB", ,) "percent_used" from ...

  2. 【发布iCore3&iCore4ADM资料】

    资料包说明: 1.解压资料包,里面有两个文件夹,iCore3和iCore4. iCore3文件夹里包含源代码及AD模块的详细资料. iCore4文件夹里仅有源代码,AD模块的详细资料参考iCore3里 ...

  3. GPT(保护分区)解决办法

    教你在硬盘被GPT保护分区后怎么格式化  GUID 分区表 (GPT) 作为可扩展固件接口 (EFI) 计划的一部分而引入.与 PC 以前通用的旧的主引导记录 (MBR) 分区方案相比,GPT 为磁盘 ...

  4. 聊聊动态语言那些事(Python)

    动态编程语言是高级程序设计语言的一个类别,在计算机科学领域已被广泛应用.它是一类在运行时可以改变其结构的语言:例如新的函数.对象.甚至代码可以被引进,已有的函数可以被删除或是其他结构上的变化.动态语言 ...

  5. EasyUI datagrid columns 中 field 区分大小写

    columns: [ [ {field: 'id', title: 'ID'}, {field: 'name', title: 'NAME'}, {field: 'DT_CRT_TM', title: ...

  6. CSS让页面平滑滚动

    我们以往实现平滑滚动往往用的是jQuery, 如实现平滑回到顶部,就写如下代码: $('.js_go_to_top').click(function () { $(".js_scroll_a ...

  7. Mysql系列八:Mycat和Sharding-jdbc的区别、Mycat分片join、Mycat分页中的坑、Mycat注解、Catlet使用

    一.Mycat和Sharding-jdbc的区别 1)mycat是一个中间件的第三方应用,sharding-jdbc是一个jar包 2)使用mycat时不需要改代码,而使用sharding-jdbc时 ...

  8. AutoIt 软件自动化操作

    AutoIt 目前最新是v3版本,这是一个使用类似BASIC脚本语言的免费软件,它设计用于Windows GUI(图形用户界面)中进行自动化操作. 它利用模拟键盘按键,鼠标移动和窗口/控件的组合来实现 ...

  9. Ubuntu 14.04 安装 Blender,并放桌面

    1.打开Blender官网 2.在主页点击down按钮,跳转到下载页面 3.根据自己的操作系统,选择合适的版本,这里使用的是ubunut 64位,所以下载Linux 64bit,保存文件,一般保存到h ...

  10. 利用Backtrace来捕获段错误堆栈信息

    具体参考文档:https://blog.csdn.net/gatieme/article/details/84189280 测试Demo: #include <execinfo.h> #i ...