在这个模块之中提供了.NET对象与*.ini配置文件之间的相互映射的序列化操作
IOProvider
01 Syntax
Microsoft.VisualBasic.ComponentModel.Settings.Inf.IOProvider
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| WriteProfile | 3 | 将目标对象写为*.ini文件 (目标对象之中的所有的简单属性都会被保存在一个对象名称的section中,) |
| GetSectionsFromCLR | 1 | 查找出所有ClassName标记的属性 |
| LoadProfile | 2 | 加载配置文件然后反序列化为一个指定类型的.NET对象 |
| WriteProfile | 2 | |
| LoadProfile | 2 |
03 Members
WriteProfile``1(
``0, String)将目标对象写为*.ini文件 (目标对象之中的所有的简单属性都会被保存在一个对象名称的section中,)
Type Parameters
| Name | Description |
|---|---|
T |
Parameters
| Name | Type | Description |
|---|---|---|
x | ``0 | - |
path | String | - |
WriteProfile``1(
``0, IniFile)将目标对象写为*.ini文件 (目标对象之中的所有的简单属性都会被保存在一个对象名称的section中,)
Type Parameters
| Name | Description |
|---|---|
T |
Parameters
| Name | Type | Description |
|---|---|---|
x | ``0 | - |
WriteProfile``1(
``0)属性的类型需要定义ClassName,Section类型里面的属性还需要 定义DataFrameColumnAttribute,否则将不会将对应的属性的值 写入到ini文件之中。
Type Parameters
| Name | Description |
|---|---|
T |
Parameters
| Name | Type | Description |
|---|---|---|
x | ``0 | - |
GetSectionsFromCLR``1
查找出所有ClassName标记的属性
Type Parameters
| Name | Description |
|---|---|
T |
LoadProfile``1(
String)从指定的*.ini文件之中加载配置数据,如果配置文件不存在,则这个函数会返回空值
Type Parameters
| Name | Description |
|---|---|
T |
Parameters
| Name | Type | Description |
|---|---|---|
path | String | - |
LoadProfile``1(
Boolean, String)加载配置文件然后反序列化为一个指定类型的.NET对象
Type Parameters
| Name | Description |
|---|---|
T |
Parameters
| Name | Type | Description |
|---|---|---|
fileExists | Boolean | - |
path | String | 如果这个参数是空值,则会需要在T类型定义之中定义有一个IniMapIO属性来存储文件路径 |
WriteProfile(
T, String)WriteProfile(
T)LoadProfile(
String)LoadProfile(
Boolean, String)