private void Form1_Load(object sender, EventArgs e) { this.Show(); if (System.Globalization.CultureInfo.CurrentCulture.TwoLetterISOLanguageName != "ko") { Button3.Visible = false; Button4.Visible = false; } int a = Screen.PrimaryScreen.Bounds.Width / 2; int b = Screen.PrimaryScreen.Bounds.Height / 2; this.Top = b - this.Height / 2; this.Left = a - this.Width / 2; OpenFileDialog1.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/.minecraft/assets/indexes"; // 설정파일 처음 세팅 appPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "/indexextract"; if (!FileSystem.FileExists(appPath + "/lang.set")) { FileSystem.CreateDirectory(appPath); FileSystem.WriteAllText(appPath + "/lang.set", "lang=EN_US", false); } //설정 파일 불러오기 string se = FileSystem.ReadAllText(appPath + "/lang.set"); string lang = ""; try { lang = Strings.Split(se, "lang=")[1]; } catch (IndexOutOfRangeException) { //todo button 3 click } if (lang == "EN_US") { Button3_Click(sender, e); } else if (lang == "KO_KR") { Button4_Click(sender, e); } else { FileSystem.DeleteFile(appPath + "/lang.set"); Application.Restart(); } this.MaximizeBox = false; Thread t = new Thread(AsyncUpCheck); t.Priority = ThreadPriority.Lowest; t.Start(); if (lang == "ko") { Label4.Text = "대기"; } else if (lang == "en") { Label4.Text = "Wait"; } }
private void Button1_Click(object sender, EventArgs e) { if (lang == "ko") { Label4.Text = "준비 중"; } else if (lang == "en") { Label4.Text = "Preparing"; } BrowserResult br = new BrowserResult(); try { br = Form2.GetResult(); } catch (NullReferenceException) { MessageBox.Show("ERR_FILE_NOT_SELECTED", "Indexextract", MessageBoxButtons.OK); return; } abcd = Strings.Split(br.file, "\\").Length - 1; Label7.Text = "0"; Label8.Text = "0"; ProgressBar1.Value = 0; i = 0; index = 3; ale = 0; ncp = 0; Label4.Visible = true; Label3.Visible = true; Label1.Visible = true; Button2.Enabled = false; Button1.Enabled = false; Button5.Enabled = false; if (lang == "ko") { Label4.Text = "작업 중"; } else if (lang == "en") { Label4.Text = "Working"; } string fullt = FileSystem.ReadAllText(br.file); b = Strings.Split(fullt, "hash").Length - 1; WorkDataObj = new WorkData() { dataJson = Strings.Split(fullt, "\""), targetPath = $"{Application.StartupPath}\\indexextract\\{Strings.Split(Strings.Split(br.file, "\\")[abcd], ".json")[0]}" }; Thread t = new Thread(WorkThread); t.Name = "Indexextract worker"; t.Priority = ThreadPriority.Highest; t.Start(); }