本文整理汇总了C#中IniFile.GetSetting方法的典型用法代码示例。如果您正苦于以下问题:C# IniFile.GetSetting方法的具体用法?C# IniFile.GetSetting怎么用?C# IniFile.GetSetting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IniFile
的用法示例。
在下文中一共展示了IniFile.GetSetting方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: item
public item(int id)
{
string filename = new IniFile(game.root + "\\items\\ids.ini").GetSetting("ids", id.ToString());
dataIni = new IniFile(game.root + "\\items\\" + filename);
id = Convert.ToInt32(dataIni.GetSetting("identification", "id"));
filename = dataIni.GetSetting("identification", "filename");
name = dataIni.GetSetting("identification", "name");
takeable = Convert.ToBoolean(dataIni.GetSetting("flags", "takeable"));
useable = Convert.ToBoolean(dataIni.GetSetting("flags", "useable"));
weapon = Convert.ToBoolean(dataIni.GetSetting("flags", "weapon"));
key = Convert.ToBoolean(dataIni.GetSetting("flags", "key"));
eatable = Convert.ToBoolean(dataIni.GetSetting("flags", "eatable"));
damage = Convert.ToInt32(dataIni.GetSetting("properties", "damage"));
heal = Convert.ToInt32(dataIni.GetSetting("properties", "heal"));
weight = Convert.ToDouble(dataIni.GetSetting("properties", "weight"));
}
示例2: ReadGameInfoAndSettings
private void ReadGameInfoAndSettings()
{
IniFile settingsFile = new IniFile("settings.ini");
SettingsFromIni.SvnCliExePath = settingsFile.GetSetting("settings", "svn_cli_exe");
SettingsFromIni.SvnOptions = settingsFile.GetSetting("settings", "svn_options");
SettingsFromIni.SvnInteractivePassword = settingsFile.GetSetting("settings", "svn_passwd");
SettingsFromIni.MsbuildExePath = settingsFile.GetSetting("settings", "msbuild_exe");
SettingsFromIni.VCSExePath = settingsFile.GetSetting("settings", "vcs_exe");
NumberOfToolsInIni = Int32.Parse(settingsFile.GetSetting("tools", "number_of_tools"));
// 1 based indexing!
for (int i = 1; i <= NumberOfToolsInIni; i++)
{
string prefix = String.Format("tool{0}_", i);
tools.Add(new ContentTool()
{
ToolExe = settingsFile.GetSetting("tools", prefix + "add_content_exe"),
TemplateFile = settingsFile.GetSetting("tools", prefix + "content_template_file"),
ContentDescription = settingsFile.GetSetting("tools", prefix + "content_description"),
ContentSubfolder = settingsFile.GetSetting("tools", prefix + "content_subfolder"),
ContentExt = settingsFile.GetSetting("tools", prefix + "content_ext")
});
}
// Game
WorkshopGame = new GameRecord(){
PupilGroupName=settingsFile.GetSetting("gameinfo","pupil_group_name"),
GameName=settingsFile.GetSetting("gameinfo","game_name"),
SVNRepo=settingsFile.GetSetting("gameinfo","repository_url"),
toProcess=new List<string>(){"."}, // Root folder
Solution=settingsFile.GetSetting("gameinfo","solution_file"),
ContentFolder=settingsFile.GetSetting("gameinfo","content_folder"),
TemplateFolder=settingsFile.GetSetting("gameinfo","template_folder")
};
}