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


C# IniFile.IniReadValue方法代码示例

本文整理汇总了C#中IniFile.IniReadValue方法的典型用法代码示例。如果您正苦于以下问题:C# IniFile.IniReadValue方法的具体用法?C# IniFile.IniReadValue怎么用?C# IniFile.IniReadValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IniFile的用法示例。


在下文中一共展示了IniFile.IniReadValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetTiltShift

        private IEnumerator SetTiltShift()
        {
            using (WWW www = new WWW(@"file://" + System.IO.Path.Combine(System.IO.Path.Combine(Path, "ab"),"shader")))
            {
                yield return www;

                if (www.error != null)
                    throw new Exception("Loading had an error:" + www.error);

                AssetBundle bundle = www.assetBundle;

                Shader s = bundle.LoadAsset<Shader>("TiltShiftHdrLensBlur");

                TiltShift = Camera.main.gameObject.AddComponent<TiltShift>();

                TiltShift.tiltShiftShader = s;
                TiltShift.quality = TiltShift.TiltShiftQuality.High;

                // check if ini exists, if it does load the settings from it, otherwise set defaults
                if (File.Exists(Path + @"/settings.ini"))
                {
                    IniFile ini = new IniFile(Path + @"/settings.ini");

                    TiltShift.blurArea = float.Parse(ini.IniReadValue("General", "blur_area"));
                    TiltShift.maxBlurSize = float.Parse(ini.IniReadValue("General", "max_blur_size"));
                    TiltShift.downsample = int.Parse(ini.IniReadValue("General", "downsample"));
                }
                else
                {
                    TiltShift.blurArea = 2;
                }

                bundle.Unload(false);
            }
        }
开发者ID:ParkitectNexus,项目名称:TiltShift,代码行数:35,代码来源:TiltShiftAttacher.cs

示例2: loadConfiguration

 public static void loadConfiguration()
 {
     try
     {
         IniFile iniFile = new IniFile(AppDomain.CurrentDomain.BaseDirectory + "config.ini");
         //General
         Path2 = iniFile.IniReadValue("General", "LauncherPath");
         maxBots = Convert.ToInt32(iniFile.IniReadValue("General", "MaxBots"));
         maxLevel = Convert.ToInt32(iniFile.IniReadValue("General", "MaxLevel"));
         replaceConfig = Convert.ToBoolean(iniFile.IniReadValue("General", "ReplaceConfig"));
         //Account
         Region = iniFile.IniReadValue("Account", "Region").ToUpper();
         //Donator
         if (isDonator)
         {
             championId = iniFile.IniReadValue("Donator", "ChampionPick").ToUpper();
             buyBoost = Convert.ToBoolean(iniFile.IniReadValue("Donator", "BuyBoost"));
             rndSpell = Convert.ToBoolean(iniFile.IniReadValue("Donator", "RndSpell"));
             spell1 = iniFile.IniReadValue("Donator", "Spell1").ToUpper();
             spell2 = iniFile.IniReadValue("Donator", "Spell2").ToUpper();
         }
     }
     catch (Exception e)
     {
         Console.WriteLine(e.Message);
         Thread.Sleep(10000);
         Application.Exit();
     }
 }
开发者ID:honomoa,项目名称:JAutoQueue,代码行数:29,代码来源:Core.cs

示例3: AppSettings

        public AppSettings()
        {
            appdata_folder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
               // MessageBox.Show(appdata_folder);
            if (Directory.Exists(appdata_folder + "\\Tejash Player") == false)
            {
                Directory.CreateDirectory(appdata_folder + "\\Tejash Player");
                appdata_folder = appdata_folder + "\\Tejash Player";
                Settings.Default.FirstRun = true;
                Settings.Default.Save();
            }
            else
                appdata_folder = appdata_folder + "\\Tejash Player";

            if (Directory.Exists(appdata_folder) == false)
                MessageBox.Show("Unable to locate the temporary data folder!\nSome features may not work properly");

            if (File.Exists(appdata_folder + "\\TejashPlayer.DLL"))
            {
                IniFile ini = new IniFile(appdata_folder + "\\TejashPlayer.DLL");
                string key = ini.IniReadValue("RegInfo", "Key");
                if (key.Trim().Length > 0)
                {
                    if (key.Length == 29)
                    {
                        if (core.CheckKey(key,appdata_folder))
                        {
                            Reg = true;
                            RegName = ini.IniReadValue("RegInfo", "Name");
                            playerName = "Tejash Player Pro";
                        }
                    }
                }
            }
        }
开发者ID:tejashwikalptaru,项目名称:Tejash-Player,代码行数:35,代码来源:AppSettings.cs

示例4: loadConfig

 /// <summary>
 /// Load the configuration
 /// </summary>
 public static void loadConfig()
 {
     if (File.Exists(confPath))
     {
         IniFile ini = new IniFile(confPath);
         url = ini.IniReadValue("main", "url");
         token = ini.IniReadValue("main", "token");
     }
 }
开发者ID:Wolfium,项目名称:gitlab-ci-runner-win,代码行数:12,代码来源:Config.cs

示例5: romPaths

        public romPaths()
        {
            InitializeComponent();

            string p = System.Reflection.Assembly.GetExecutingAssembly().Location;
            iniFile = new IniFile( p.Substring( 0, p.Length - 3 ) + "ini" );
            SNES_path.Text =iniFile.IniReadValue( "rompaths", "SNES" );
            NES_path.Text = iniFile.IniReadValue( "rompaths", "NES" );
            GBA_path.Text = iniFile.IniReadValue( "rompaths", "GBA" );
            GB_path.Text = iniFile.IniReadValue( "rompaths", "GB" );
        }
开发者ID:MiLO83,项目名称:higanui,代码行数:11,代码来源:rompaths.cs

示例6: WelcomeWindow_Load

        private void WelcomeWindow_Load(object sender, EventArgs e)
        {

            
            // Regions
            

            if (_forConfig)
            {
                button6.Text = "Close";
                tabControl1.SelectTab(1);
                label4.Text = "Global Settings";
                button6.Click += button6_alternate;
                textBox1.Text = Config.defaultPath;
                Text = "Global / Default Configuration";
                richTextBox2.Text = "Need to change settings, mh? Configurate here the default settings for new bots.";
                string folder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
                specificFolder = Path.Combine(folder, "LoliBot");
                string path = specificFolder;

                string test = System.IO.Path.Combine(path, "version.ini");

                IniFile ini = new IniFile(path + "\\version.ini");
                string ver = "";
                ver = ini.IniReadValue("General", "version");
                if (ver == "")
                {
                    ver = Config.clientSeason + "." + Config.clientSubVersion;
                    ini.IniWriteValue("General", "version", Config.clientSeason + "." + Config.clientSubVersion);
                }
                this.textBox1.Text = ver; 
            }
        }
开发者ID:lolibot,项目名称:LolibotGui-Code,代码行数:33,代码来源:WelcomeWindow.cs

示例7: FormLicense_Load

        private void FormLicense_Load(object sender, EventArgs e)
        {
            if (!Directory.Exists("configs"))
            {
                Directory.CreateDirectory("configs");
                setup = true;
            }
            if (!File.Exists(FileNames.SettingsIni))
                setup = true;

            settingsIni = new IniFile(FileNames.SettingsIni);

            if (!int.TryParse(settingsIni.IniReadValue("Profiles", "Active"), out activeProfile) || activeProfile < 1 || activeProfile > 4)
                setup = true;

            if (setup) InitialSetup();
            else
            {
                // select the right radio button
                radioButton1.Checked = activeProfile == 1;
                radioButton2.Checked = activeProfile == 2;
                radioButton3.Checked = activeProfile == 3;
                radioButton4.Checked = activeProfile == 4;
            }
        }
开发者ID:rossmas,项目名称:zomination,代码行数:25,代码来源:FormProfileCreate.cs

示例8: MainWindow

        public MainWindow()
        {
            InitializeComponent();

            this.DataContext = this;
            //课程下拉列表更新
            classes.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(classes_CollectionChanged);
            savedStuIds.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(savedStuIds_CollectionChanged);
            ClassScores.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(ClassScores_CollectionChanged);
            //获取查询地址
            IniFile inifile = new IniFile(Directory.GetCurrentDirectory() + "\\config.ini");
            var keys = inifile.ReadKeys("QUERY");
            baseUrl = inifile.IniReadValue("QUERY", "baseurl");
            querypara = inifile.IniReadValue("QUERY", "param");

            //获取xml课程列表
            XmlDocument doc = new XmlDocument();
            string path = Directory.GetCurrentDirectory() + "\\classes.xml";
            if (File.Exists(path))
            {
                doc.Load(path);
                XmlNodeList lis = doc.GetElementsByTagName("class");
                for (int i = 0; i < lis.Count; i++)
                {
                    classes.Add(new KeyValuePair<string, string>(lis[i].Attributes["id"].Value, lis[i].InnerText));
                }
            }
            else
            {
                MessageBox.Show("没有课程,请先添加课程","提示",MessageBoxButton.OK,MessageBoxImage.Information);
                AddClassMap_Click(null, null);
            }

            //获取stuid
            XmlDocument doc1 = new XmlDocument();
            string path1 = Directory.GetCurrentDirectory() + "\\stuid.xml";
            if (File.Exists(path1))
            {
                doc.Load(path1);
                XmlNodeList lis = doc.GetElementsByTagName("stu");
                for (int i = 0; i < (lis.Count<10?lis.Count:10); i++)
                {
                    SavedStuIds.Add(new KeyValuePair<string, string>(lis[i].Attributes["id"].Value, lis[i].InnerText));
                }
            }
        }
开发者ID:pierre94,项目名称:GrScore,代码行数:46,代码来源:MainWindow.xaml.cs

示例9: getInstallDirectory

 public static string getInstallDirectory()
 {
     if (lastExecutablePath == "")
     {
         IniFile ini = new IniFile(getConfigPath() + @"\global.ini");
         lastExecutablePath = ini.IniReadValue("General", "LastAppDirectory");
     }
     return lastExecutablePath;
 }
开发者ID:becelot,项目名称:HDT_VideoRecorder,代码行数:9,代码来源:OBSUtils.cs

示例10: CheckAndFixSettings

        private void CheckAndFixSettings()
        {
            IniFile settingsIni = new IniFile(FileNames.SettingsIni);
            if (!int.TryParse(settingsIni.IniReadValue("Profiles", "Active"), out activeProfile))
            {
                new FormProfileCreate().ShowDialog();
                activeProfile = int.Parse(settingsIni.IniReadValue("Profiles", "Active"));
            }

            // if Options doesn't exist, create default
            if (string.IsNullOrEmpty(settingsIni.IniReadValue("Options", "Fullscreen")) ||
                string.IsNullOrEmpty(settingsIni.IniReadValue("Options", "UseGamePad")) ||
                string.IsNullOrEmpty(settingsIni.IniReadValue("Options", "MSAA")))
            {
                settingsIni.IniWriteValue("Options", "Fullscreen", "True");
                settingsIni.IniWriteValue("Options", "MSAA", "4");
                settingsIni.IniWriteValue("Options", "UseGamePad", "False");
            }
        }
开发者ID:rossmas,项目名称:zomination,代码行数:19,代码来源:FormMain.cs

示例11: frm_check_comment_Load

 private void frm_check_comment_Load(object sender, EventArgs e)
 {
     frm_main frm = (frm_main)this.Owner;
     IniFile settings = new IniFile(Directory.GetCurrentDirectory() + "\\Settings\\" + frm.current_pos + ".ini");
     tb_prefix1.Text = settings.IniReadValue("NFComments", "CheckPrefix1");
     tb_prefix2.Text = settings.IniReadValue("NFComments", "CheckPrefix2");
     tb_prefix3.Text = settings.IniReadValue("NFComments", "CheckPrefix3");
     tb_prefix4.Text = settings.IniReadValue("NFComments", "CheckPrefix4");
     tb_prefix5.Text = settings.IniReadValue("NFComments", "CheckPrefix5");
     tb_prefix6.Text = settings.IniReadValue("NFComments", "CheckPrefix6");
     tb_postfix1.Text = settings.IniReadValue("NFComments", "CheckPostfix1");
     tb_postfix2.Text = settings.IniReadValue("NFComments", "CheckPostfix2");
 }
开发者ID:sylion,项目名称:SMarketSettings,代码行数:13,代码来源:frm_check_comment.cs

示例12: GetNfcWriteKey

 public string GetNfcWriteKey()
 {
     var ini = new IniFile(INI_PATH);
     string key = ini.IniReadValue("NFC", "WriteKey");
     if (string.IsNullOrWhiteSpace(key))
         return null;
     else
     {
         //Base64 Coding is just to obscure the Key in the File
         var arr = Convert.FromBase64String(key);
         return System.Text.ASCIIEncoding.ASCII.GetString(arr);
     }
 }
开发者ID:nrusitska,项目名称:radx_automat,代码行数:13,代码来源:DataManager.cs

示例13: loadDefaultChars

        /// <summary>
        /// Load the initial chars from INI file
        /// </summary>
        private void loadDefaultChars(IniFile ini)
        {            
            string chars = ini.IniReadValue("mua", "chars");
            //LOAD chars
            for (int i = 1; i <= 27; i++)
            {
                if (i == 27) i = 96;

                string path = ini.IniReadValue("defaultchars", i + "");
                if (!path.Equals(""))
                {
                    if (!chars.Equals("")) path = chars + "//" + path;
                    if (!path.EndsWith(".txt")) path += ".txt";

                    FileInfo file = new FileInfo(path);
                    path = file.FullName;
                    if (file.Exists)
                    {
                        string name = file.Name.Remove(file.Name.Length - 4);
                        addSelectedChar(i, name, path);
                    }
                    else
                    {
                        log("ERROR: file not found: " + path);
                    }
                }
            }
            //load save slots
            saveSlots.cleanAll();
            for (int i = 1; i <= 20; i++) 
            {
                string slot = ini.IniReadValue("saves", "slot" + i);
                if (slot.ToUpper().Equals("TRUE")) {
                    saveSlots.setChecked(i);
                }
            }
        }
开发者ID:merttas077,项目名称:muaopenheroselect,代码行数:40,代码来源:Main.cs

示例14: Init

        static void Init()
        {
            Console.ForegroundColor = ConsoleColor.Gray;
            Console.WriteLine("ScreenshotBot is bootstrapping...");

            try
            {
                reddit = new Reddit();
                Reddit.UserAgent = "ScreenshotBot";
                ini = new IniFile("sst.ini");
                reddit.LogIn(ini.IniReadValue("ACCOUNT", "Username"), ini.IniReadValue("ACCOUNT", "Password"));
                var inisub = ini.IniReadValue("BOT", "Subreddit");
                if (inisub == "all") sub = Subreddit.GetRSlashAll(reddit);
                else sub = reddit.GetSubreddit(inisub);
                popular = new BlackList("popular", ini);
                www = ini.IniReadValue("BOT", "www");
                template = ini.IniReadValue("BOT", "Template");

                Work1 = new List<Post>();
                Work2 = new List<Post>();
                ProcessedURLs = new List<string>();

                ThreadPool.QueueUserWorkItem(new WaitCallback(ScreenshotWorker), 1);
                ThreadPool.QueueUserWorkItem(new WaitCallback(ScreenshotWorker), 2);

            }
            catch (Exception ex)
            {
                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("Initialization failure! Error details: \r\n" + ex.ToString());
                Console.ReadLine();
                return;
            }

            Console.WriteLine("ScreenshotBot was successfully initialized!\n----------------------------------------------------------\r\n\r\n");
        }
开发者ID:jariz,项目名称:ScreenshotBot,代码行数:36,代码来源:Program.cs

示例15: StartGame

        private void StartGame(string key)
        {
            KillCurrentGame();

            IniFile config = new IniFile(DataManager.INI_PATH);
            var command = config.IniReadValue("ArcadeCommands", key);
            var args = command.Split(' ');
            string cmd = args[0];
            string param = string.Join(" ", args.Skip(1));

            var startinf = new ProcessStartInfo(cmd, param);
            startinf.WorkingDirectory = Path.GetDirectoryName(cmd);
            startinf.UseShellExecute = false;
            startinf.CreateNoWindow = true;
            _currentGame = Process.Start(startinf);
        }
开发者ID:nrusitska,项目名称:radx_automat,代码行数:16,代码来源:ArcadeInteractionManager.cs


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