-
Notifications
You must be signed in to change notification settings - Fork 0
Home
QQ edited this page Jan 28, 2022
·
12 revisions
Welcome to the QSoft.Ini wiki!
hope this document can help your work.
Setting setting = new Setting()
{
IP = "127.0.0.1",
Port = 88
};
string ini_str = IniConvert.SerializeObject(setting);
/*
[Setting]
IP=127.0.0.1
Port=88
*/
var deserialize = IniConvert.DeserializeObject<Setting>(ini_str);Use attribute ignore exist property
public class Setting
{
[IniIgnore]
public string IP { set; get; }
public int Port { set; get; }
}
string ini_str = IniConvert.SerializeObject(setting);
/*
[Setting]
Port=88
*/Use attribute ignore exist property
public class Setting
{
[IniSectionKey()]
public string IP { set; get; }
[IniSectionKey(Key ="DefaultPort")]
public int Port { set; get; }
}
string ini_str = IniConvert.SerializeObject(setting);
/*
[Setting]
IP=127.0.0.1
DefaultPort=88
*/