Beispiel #1
0
        public string NaPath(string iniPath)
        {
            //取得美服安裝路徑
            CFGFile CFGFile = new CFGFile(iniPath);

            //檢查 config.ini
            if (!String.IsNullOrEmpty(CFGFile.GetValue("LoLPath", "NaPath")))
            {
                string tmp = CFGFile.GetValue("LoLPath", "NaPath");
                installPath = tmp.Replace("\"", "");
                return installPath;
            }

            if (My.Computer.Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Riot Games\League of Legends", "Path", null) != null)
            {
                string value = My.Computer.Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Riot Games\League of Legends", "Path", null).ToString();
                if (value.Contains("League of Legends"))
                {
                    installPath = My.Computer.Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Riot Games\League of Legends", "Path", null).ToString();
                    return installPath;
                }
            }

            if (My.Computer.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Riot Games\League of Legends", "Path", null) != null)
            {
                string value = My.Computer.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Riot Games\League of Legends", "Path", null).ToString();
                if (value.Contains("League of Legends"))
                {
                    installPath = My.Computer.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Riot Games\League of Legends", "Path", null).ToString();
                    return installPath;
                }
            }
            return "";
        }
Beispiel #2
0
        public static string installPath = "";  //LoL安裝路徑

        public string TwPath(string iniPath)   //取得台服LoL路徑
        {
            CFGFile CFGFile = new CFGFile(iniPath);

            //檢查 config.ini
            if (!String.IsNullOrEmpty(CFGFile.GetValue("LoLPath", "TwPath")))
            {
                string tmp = CFGFile.GetValue("LoLPath", "TwPath");
                installPath = tmp.Replace("\"", "");
                return installPath;
            }

            if (My.Computer.Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Garena\LoLTW", "Path", null) != null)
            {
                string value = My.Computer.Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Garena\LoLTW", "Path", null).ToString();
                if (value.Contains("LoLTW"))
                {
                    installPath = My.Computer.Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Garena\LoLTW", "Path", null).ToString();
                    return installPath;
                }
            }

            if (My.Computer.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Garena\LoLTW", "Path", null) != null)
            {
                string value = My.Computer.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Garena\LoLTW", "Path", null).ToString();
                if (value.Contains("LoLTW"))
                {
                    installPath = My.Computer.Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Garena\LoLTW", "Path", null).ToString();
                    return installPath;
                }
            }
            return "";
        }