首页 > Windows开发 > 详细

C#操作INI文件之Vini.cs的使用

时间:2019-02-06 16:40:32      阅读:259      评论:0      收藏:0      [点我收藏+]

Write

概要

VINI.cs是用于对INI文件进行读写的类。

Constructor 构造器

VINI(string)

使用文件路径初始化类
Parameters
filepath [string]
目标INI文件的路径
Exceptions
None
Notice
不保证目标文件一定可以打开

Properties 属性

IniFilePath

Property Value
[string]
目标INI文件的路径

isFileExistence

Property Value
[boolean]
true - 目标文件存在
false - 目标文件不存在

DefaultText

Property Value
[string]
当找不到目标键值时返回的默认字符串

Methods 方法

SetPath

设置目标文件路径
Parameters
path [string]
目标INI文件路径
Returns
[bool]
true - 目标文件存在
false - 目标文件不存在
Notices
输入相对路径,已自动加入 “./”

Read

读取一个键值
Parameter
· Section [string]
节名
· Key [string]
键名
Returns
[string]
读取到的键值
Exceptions
当未设置文件路径时
Notices
如果读取不到对应的键值,返回 VINI.DefaultText

Write

Parameters
· Section [string]
节名
· Key [string]
键名
· Value [string]
写入的值
Returns
[boolean]
true - 写入成功
false - 写入失败
Exceptions
当未设置文件路径时

C#操作INI文件之Vini.cs的使用

原文:https://www.cnblogs.com/velscode/p/10353783.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!