private void Button1_Click(object sender, EventArgs e) { if (text1Hint == false) { LV1.Items.Clear(); textBox2.Clear(); Button2.Visible = false; Button3.Visible = false; Button6.Visible = false; linkLabel1.Text = ""; Text = "psDLC2"; textBox1.SelectionStart = textBox1.Text.Length; textBox1.SelectionLength = 0; if (textBox1.Text.Length == 9 && textBox1.Text.ToLower().Contains("cusa")) { textBox1.Text = textBox1.Text.ToUpper(); PDL1.GetPkgList(textBox1.Text); } else if (textBox1.Text.StartsWith("http") && textBox1.Text.Contains(".com/") && textBox1.Text.Contains("/product/") && textBox1.Text.ToLower().Contains("cusa") && textBox1.Text.Length > 36) { pageNum = 1; htmBuffer = string.Empty; string[] Spl1, Spl2; Spl1 = Regex.Split(textBox1.Text, ".com/"); Spl2 = Regex.Split(Spl1[1], "/"); titleRgn = Spl2[0]; Spl1 = Regex.Split(textBox1.Text, "/product/"); titleID = Strings.Mid(Spl1[1], 8, 12); PDL1.GetDlcList(titleID, titleRgn, pageNum); } else if (textBox1.Text.Length >= 19 && textBox1.Text.ToLower().Contains("cusa")) { textBox1.Text = textBox1.Text.ToUpper(); pageNum = 1; htmBuffer = string.Empty; titleID = Strings.Mid(textBox1.Text, 8, 12); switch (Strings.Mid(textBox1.Text, 1, 1)) { case "U": titleRgn = "en-us"; break; case "E": titleRgn = "en-gb"; break; case "I": titleRgn = "en-us"; break; default: titleRgn = "ja-jp"; break; } PDL1.GetDlcList(titleID, titleRgn, pageNum); } else if (textBox1.Text.Length >= 19 && textBox1.Text.ToLower().Contains("store-ms")) { textBox1.Text = textBox1.Text.ToUpper(); pageNum = 1; htmBuffer = string.Empty; titleID = textBox1.Text; switch (Strings.Mid(titleID, 7, 8)) { case "MSF77008": titleRgn = "en-us"; break; case "MSF75508": titleRgn = "en-gb"; break; default: titleRgn = "en-us"; break; } PDL1.GetDlcList(titleID, titleRgn, pageNum); } else { AppLog("ERROR: Invalid Content ID" + Environment.NewLine + "Use the content id in the following formats:\r\n CUSA00000 \r\nor\r\n XX0000-CUSA00000_00-0000000000000000 \r\nor\r\n PS Store URL: https://store.playstation.com/xx-xx/product/XX0000-CUSA00000_00-0000000000000000"); } } }
private void Button1_Click(object sender, EventArgs e) { button7.Visible = false; isSearch = false; if (textBox1.Text != String.Empty) { string[] Spl1, Spl2; LV1.Items.Clear(); textBox2.Clear(); Button2.Visible = false; Button3.Visible = false; linkLabel1.Text = ""; Text = "psDLC"; textBox1.SelectionStart = textBox1.Text.Length; textBox1.SelectionLength = 0; if (textBox1.Text.Length == 12 && textBox1.Text.EndsWith("_00")) { textBox1.Text = textBox1.Text.Substring(0, textBox1.Text.Length - 3); } if (textBox1.Text.Length == 9 && textBox1.Text.ToLower().Contains("cusa")) { textBox1.Text = textBox1.Text.ToUpper(); PDL1.GetPkgList(textBox1.Text); } else if (textBox1.Text.Length == 9 && textBox1.Text.ToLower().Contains("ppsa")) { textBox1.Text = textBox1.Text.ToUpper(); PDL1.GetDlcList(textBox1.Text, comboBox1.Text); } else if (textBox1.Text.StartsWith("http") && textBox1.Text.Contains(".com/") && textBox1.Text.Contains("/product/") && textBox1.Text.ToLower().Contains("cusa") && textBox1.Text.Length > 36) { htmBuffer = string.Empty; Spl1 = Regex.Split(textBox1.Text, ".com/"); Spl2 = Regex.Split(Spl1[1], "/"); titleRgn = Spl2[0]; Spl1 = Regex.Split(textBox1.Text, "/product/"); titleID = Spl1[1].Substring(7, 12); textBox1.Text = Spl1[1].Substring(7, 9); PDL1.GetDlcList(titleID, titleRgn); } else if (textBox1.Text.Length >= 19 && textBox1.Text.ToLower().Contains("cusa")) { textBox1.Text = textBox1.Text.ToUpper(); htmBuffer = string.Empty; titleID = textBox1.Text.Substring(7, 12); switch (textBox1.Text.Substring(0, 1)) { case "U": titleRgn = "en-us"; break; case "E": titleRgn = "en-gb"; break; case "I": titleRgn = "en-us"; break; default: titleRgn = "ja-jp"; break; } textBox1.Text = textBox1.Text.Substring(7, 9); PDL1.GetDlcList(titleID, titleRgn); } else if (textBox1.Text.Length >= 19 && textBox1.Text.ToLower().Contains("-ppsa") && textBox1.Text.ToLower().Contains("_00")) { textBox1.Text = textBox1.Text.ToUpper(); Spl1 = Regex.Split(textBox1.Text, "-PPSA"); Spl2 = Regex.Split(Spl1[1], "_"); textBox1.Text = "PPSA" + Spl2[0]; PDL1.GetDlcList(textBox1.Text, ""); } else { isSearch = true; PDL1.GetSearch(textBox1.Text, comboBox1.Text); } } }