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 ...
随机推荐
- 《软件测试自动化之道》读书笔记 之 基于Windows的UI测试
<软件测试自动化之道>读书笔记 之 基于Windows的UI测试 2014-09-25 测试自动化程序的任务待测程序测试程序 启动待测程序 获得待测程序主窗体的句柄 获得有名字控件的 ...
- Ubuntu下的Wine&WineQQ
一.安装Wine 1.添加PPA sudo add-apt-repository ppa:ubuntu-wine/ppa 2.更新列表 sudo apt-get update 3.安装Wine sud ...
- Opencv Mat运算(转)
一.矩阵Mat I,img,I1,I2,dst,A,B; double k,alpha; Scalar s; //注意Mat的行列号是从0开始的 //定义矩阵a,b,c Mat a,b,c; //生成 ...
- js中如何把字符串转化为对象、数组示例代码
很明显是一个对象,但如何把文本转为对象呢.使用eval();注意一定要加括号,否则会转换失败 把文本转化为对象 var test='{ colkey: "col", colsinf ...
- 实时折射、镜面反射shader
原文链接:http://www.ceeger.com/forum/read.php?tid=3162&fid=2 Unity没有原生的实时镜面反射Shader,分享几个自己写的,希望能抛砖引玉 ...
- Python 函数(参数组合)
在Python中定义函数,可以用必选参数.默认参数.可变参数和关键字参数,这4种参数都可以一起使用,或者只用其中某些,但是请注意,参数定义的顺序必须是:必选参数.默认参数.可变参数和关键字参数 定义一 ...
- 《Python3网络爬虫开发实战》
推荐:★ ★ ★ ★ ★ 第1章 开发环境配置 第2章 网页基础知识 第3章 网络爬虫基础 第4章 基本库的使用 第5章 解析库的使用 第6章 数据存储 第7章 Ajax数据爬取 第8章 动态渲染页面 ...
- C/C++判断传入的UTC时间是否在今天
在项目中经常会显示一个时间,如果这个时间在今日内就显示为时分秒,否则显示为年月日. 这里先给出一个正确的版本: #include <iostream> #include <time. ...
- Asp.Net Identity cookie共享
n the Startup.Auth.cs file, add the CookieDomain parameter with your domain: var cookieAuthenticatio ...
- spring的一些其他功能
今天看书,知识点多一点了,涉及到了较多的知识,如scheduling计划任务,spring对多线程的支持,以及配置开发.测试和生产环境的profile.这些都是集成在spring中的,需要用时可以参考 ...