当前位置: 首页>>代码示例>>C#>>正文


C# IniFile.GetSetting方法代码示例

本文整理汇总了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"));
        }
开发者ID:MaDOS,项目名称:-ci_texAdEngine1,代码行数:20,代码来源:item.cs

示例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")
        };
    }
开发者ID:juherask,项目名称:PeliPaja,代码行数:36,代码来源:WorkshopClient.cs


注:本文中的IniFile.GetSetting方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。