private void button1_Click(object sender, EventArgs e) { MessageBoxManager.Yes = "AFH"; MessageBoxManager.No = "SF"; MessageBoxManager.Cancel = "Cancel"; MessageBoxManager.Register(); DialogResult answer = MessageBox.Show(res_man.GetString("AboutForm_DownloadUpdate_Server", cul) + " \n*Android File Host (AFH) \n*SourceForge (SF)", "Moto_Boot_Logo_Maker " + res_man.GetString("AboutDownloadUpdateServerTitle", cul), MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information); switch (answer) { case DialogResult.Yes: InternetCheck.CheckInternetProcessStart("https://androidfilehost.com/?w=files&flid=323184"); MessageBoxManager.Unregister(); this.Close(); break; case DialogResult.No: InternetCheck.CheckInternetProcessStart("https://sourceforge.net/projects/motobootlogomaker/files/PORTABLE/"); MessageBoxManager.Unregister(); this.Close(); break; case DialogResult.Cancel: MessageBoxManager.Unregister(); return; } MessageBoxManager.Unregister(); }
public void GetData(IProgress <int> progress) { Thread.Sleep(100); labelGetting.Text = res_man.GetString("DownloadSForm_GettingServerData_Text", cul) + ". "; if (InternetCheck.ConnectToInternet() == true) { labelGetting.Text = res_man.GetString("DownloadSForm_GettingServerData_Text", cul) + ". . "; InternetCheck.CheckPageIsAliveAsync("https://sourceforge.net/projects/motobootlogomaker/files/"); labelGetting.Text = res_man.GetString("DownloadSForm_GettingServerData_Text", cul) + ". . . "; InternetCheck.CheckPageIsAliveAsync("https://www.androidfilehost.com/?w=files&flid=323184"); labelGetting.Text = res_man.GetString("DownloadSForm_GettingServerData_Text", cul) + ". "; LoadSFS(); labelGetting.Text = res_man.GetString("DownloadSForm_GettingServerData_Text", cul) + ". . "; cAppend(" "); LoadAFH(); labelGetting.Text = res_man.GetString("DownloadSForm_GettingServerData_Text", cul) + ". . . "; } else { labelGetting.Text = res_man.GetString("DownloadSForm_GettingServerData_Error_Uknown", cul); cAppend(res_man.GetString("DownloadSForm_InternetError", cul)); btnGoTo.Enabled = false; button1.Enabled = false; return; } }
public void CheckForUpdates() { if (InternetCheck.ConnectToInternet() == true) { if (InternetCheck.CheckServerRed("https://raw.githubusercontent.com/Franco28/Moto_Boot_Logo_Maker/master/Windows/OTAS/updates.xml") == true) { cAppend(res_man.GetString("AboutForm_Updates", cul) + " " + res_man.GetString("AboutForm_DownloadUpdate_ServerDown", cul)); return; } else { AutoUpdater.CheckForUpdateEvent += AutoUpdaterOnCheckForUpdateEvent; timer1.Interval = (2 * 5 * 100); timer1.Tick += new EventHandler(toolupdates); AboutBox SynchronizingObject = this; timer1.Start(); } } else { AutoUpdater.CheckForUpdateEvent -= AutoUpdaterOnCheckForUpdateEvent; timer1.Stop(); cAppend(res_man.GetString("AboutForm_Updates", cul) + " " + res_man.GetString("AboutForm_DownloadUpdate_NetLost", cul)); return; } }
public void OpenTelegram(string url) { if (InternetCheck.ConnectToInternet() == true) { Process.Start(url); } else { MessageBox.Show(res_man.GetString("MainForm_InternetCheck", cul), "Moto_Boot_Logo_Maker", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } }
public static void DebugWindwosInfo(string netframworkversion, string windowsver) { //Old folder //var path = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal).FilePath.ToString(); //var newpath = path.Replace(@"\user.config", "").Trim(); //string filePath = newpath + @"\DebugLogs\WinInfo_" + Environment.UserName + ".txt"; /*if (!Directory.Exists(newpath + @"\DebugLogs")) * { * Directory.CreateDirectory(newpath + @"\DebugLogs"); * }*/ string filePath = exePath + @"\Logs\ToolInfo_" + Environment.UserName + ".txt"; using (FileStream fs = File.Create(filePath)) { } using (StreamWriter writer = new StreamWriter(filePath, true)) { writer.WriteLine("-----------------------------------------------------------------------------"); writer.WriteLine("File Generated Date: " + DateTime.Now.ToString()); writer.WriteLine("Username: "******"Computer Name: " + SystemInformation.ComputerName); writer.WriteLine("Tool Version: v" + Application.ProductVersion); writer.WriteLine("Tool Build Date: " + Utils.GetLinkerDateTime(Assembly.GetEntryAssembly(), null).ToString()); writer.WriteLine("Main Windows Culture: " + ci.Name.ToString()); writer.WriteLine(netframworkversion); writer.WriteLine(windowsver); if (InternetCheck.ConnectToInternet() == true) { IpInfo ipInfo = new IpInfo(); string info = new WebClient().DownloadString("http://ipinfo.io"); JavaScriptSerializer jsonObject = new JavaScriptSerializer(); ipInfo = jsonObject.Deserialize <IpInfo>(info); RegionInfo region = new RegionInfo(ipInfo.Country); writer.WriteLine("Country: " + region.EnglishName); } else { writer.WriteLine("Country: Can´t connect to IP... Waiting for internet connection..."); } } using (StreamReader sr = File.OpenText(filePath)) { while ((sr.ReadLine()).StartsWith("Windows:") && (sr.ReadLine()).StartsWith("NetFramework:")) { return; } } }
private void Download_Load(object sender, EventArgs e) { if (InternetCheck.ConnectToInternet() == true) { labelGetting.Text = res_man.GetString("DownloadSForm_GettingServerData", cul); startProgressAsync(); } else { labelGetting.Text = res_man.GetString("DownloadSForm_GettingServerData_Error", cul); return; } }
private void toolupdates(object sender, EventArgs e) { if (InternetCheck.ConnectToInternet() == true) { AutoUpdater.Start("https://raw.githubusercontent.com/Franco28/Moto_Boot_Logo_Maker/master/Windows/OTAS/updates.xml"); } else { AutoUpdater.CheckForUpdateEvent -= AutoUpdaterOnCheckForUpdateEvent; timer1.Stop(); cAppend(res_man.GetString("AboutForm_Updates", cul) + " " + res_man.GetString("AboutForm_DownloadUpdate_NetLost", cul)); return; } }
private void ReadChangelog_Load(object sender, EventArgs e) { if (InternetCheck.ConnectToInternet() == true) { var webRequest = WebRequest.Create(@"https://raw.githubusercontent.com/Franco28/Moto_Boot_Logo_Maker/master/Tool/Setup/changelog.txt"); using (var response = webRequest.GetResponse()) using (var content = response.GetResponseStream()) using (var reader = new StreamReader(content)) { var strContent = reader.ReadToEnd(); richTextBox1.Text = strContent.ToString(); } } else { richTextBox1.Text = res_man.GetString("ChangelogForm_Error", cul); return; } }
private void linkLabelFileToTrasnlate_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { InternetCheck.CheckInternetProcessStart("https://sourceforge.net/projects/motobootlogomaker/files/TRANSLATIONS/en.txt/download"); }
private void pictureBox2_Click(object sender, EventArgs e) { InternetCheck.CheckInternetProcessStart("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RPY4ZNYX2VA4G&source=url"); }
private void button1_Click(object sender, EventArgs e) { InternetCheck.CheckInternetProcessStart("https://www.androidfilehost.com/?w=files&flid=323184"); }
private void btnGoTo_Click(object sender, EventArgs e) { InternetCheck.CheckInternetProcessStart("https://sourceforge.net/projects/motobootlogomaker/files/"); }