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 ...
随机推荐
- [转]对form:input标签中的数字进行格式化
原文地址:https://blog.csdn.net/qq_29662201/article/details/80708373 数字进行格式化(保留2位小数) 单独使用<fmt:formatNu ...
- 【GMT43液晶显示模块】发布原理图、出厂代码
GMT43是一款内置4.3寸真彩液晶显示模块,其内置高速ARM Cortex-M4处 理器,主频高达180MHz,并包含丰富的外设接口. GMT43拥有丰富的资源,包含RS-232,RS-485,RS ...
- centos 6.4 使用epel 源
EPEL是RHEL 的 Fedora 软件仓库,把它添上,你就可以获得 RHEL AS 的高质量.高性能.高可靠性,又需要方便易用(关键是免费)的软件包更新功能.EPEL(Extra Packages ...
- Spring Security登陆
本文参考或摘录自:http://haohaoxuexi.iteye.com/blog/2154714 在上一篇中使用Spring Security做了一些安全控制,如Spring Security 自 ...
- Mysql系列三:Centos6下安装Mysql和Mysql主从复制的搭建
一.Centos6下安装Mysql 检测下系统有没有自带的mysql:yum list installed | grep mysql, 如果已经有的话执行命令yum -y remove mysql-l ...
- 树莓派集群实践2——修改树莓派3 指定IP,DNS要修改dhcpcd.conf
vim /etc/dhcpcd.conf 修改如下 interface eth0 static ip_address=192.168.1.177/24 static routers=192.168.1 ...
- [Bayes] qgamma & rgamma: Central Credible Interval
gamma分布的density的奇怪特性,如下: Poisson的Gamma先验 h(x) 的置信区间 的 获取 > n = > sumx= > > alpha= > ...
- C#设计模式--状态模式
设计模式: 状态模式(State Pattern) 简单介绍: 在状态模式(State Pattern)中,类的行为是基于它的状态改变的.这种类型的设计模式属于行为型模式. 在状态模式中,我们创建表示 ...
- java连接数据库的基本操作
ResultSet保存查询的table数据,就像mysql的客户端显示的查询类容,但这中间还是藏有很多信息.
- 9.25中间件和Django的学过的知识总结
2018-9-25 12:10:54 参考连接:http://www.cnblogs.com/liwenzhou/p/8761803.html 浏览器访问Django的过程 面试时容易问到 Dja ...