private void Botón_Propiedades_Click(object sender, EventArgs e) { try { if (!PInvoke.Shell32.SHObjectProperties(this.Handle, PInvoke.Shell32.SHObjectPropertiesFlags.FilePath, Application.ExecutablePath, null)) { SystemSounds.Beep.Play(); } } catch (Exception Excepción) { Depurador.Escribir_Excepción(Excepción != null ? Excepción.ToString() : null); } }
private void Ventana_Acerca_SizeChanged(object sender, EventArgs e) { try { if (this.WindowState == FormWindowState.Maximized) { this.WindowState = FormWindowState.Normal; } } catch (Exception Excepción) { Depurador.Escribir_Excepción(Excepción != null ? Excepción.ToString() : null); } }
static void Main() { try { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Depurador.Iniciar_Depurador(); try { Rendimiento_Procesador = new PerformanceCounter("Processor", "% Processor Time", "_Total", true); } catch { Rendimiento_Procesador = null; } Application.Run(new Ventana_Principal()); } catch (Exception Excepción) { Depurador.Escribir_Excepción(Excepción != null ? Excepción.ToString() : null); } }
private void Ventana_Acerca_KeyDown(object sender, KeyEventArgs e) { try { if (!e.Alt && !e.Control && !e.Shift) { if (e.KeyCode == Keys.Escape || e.KeyCode == Keys.Delete) { e.Handled = true; e.SuppressKeyPress = true; this.DialogResult = DialogResult.Cancel; this.Close(); } } } catch (Exception Excepción) { Depurador.Escribir_Excepción(Excepción != null ? Excepción.ToString() : null); } }
private void Ventana_Acerca_Load(object sender, EventArgs e) { try { this.Icon = Program.Icono_Jupisoft.Clone() as Icon; this.Text = "About " + Program.Texto_Título_Versión; TextBox_Programa.Text = Texto_Programa; TextBox_Desarrollador.Text = Texto_Desarrollador; TextBox_Copyright.Text = Texto_Copyright; TextBox_Licencia.Text = Texto_Licencia; TextBox_Librerías.Text = Texto_Librerías; TextBox_Comentarios.Text = Texto_Comentarios; TextBox_Advertencia.Text = Texto_Advertencia; TextBox_Gracias.Text = Environment.UserName + " and anyone else that has ever helped me, collaborated with my multiple works or posted comments"; } catch (Exception Excepción) { Depurador.Escribir_Excepción(Excepción != null ? Excepción.ToString() : null); } }
private void Temporizador_Principal_Tick(object sender, EventArgs e) { try { Picture.Image = Filtrar_Imagen(Índice_Matiz); Picture.Invalidate(); Picture.Update(); if (Modo_Color == 0) { Índice_Matiz++; if (Índice_Matiz >= 1530) { Índice_Matiz = 0; } } } catch (Exception Excepción) { Depurador.Escribir_Excepción(Excepción != null ? Excepción.ToString() : null); } }
/// <summary> /// Loads in the memory all the possible exceptions stored in the "Debugger" file. /// </summary> internal void Cargar_Errores() { try { if (!Ocupado) { long Depurador_Errores = 0L, Depurador_Errores_Únicos = 0L; string Texto = null; Lector_Depurador = new FileStream(Application.StartupPath + "\\Debugger", FileMode.OpenOrCreate, FileAccess.Read, FileShare.ReadWrite); Lector_Depurador.Seek(8L, SeekOrigin.Begin); Lector_Depurador_Binario = new BinaryReader(Lector_Depurador, Encoding.ASCII); if (Lector_Depurador != null && Lector_Depurador_Binario != null && Lector_Depurador.Length > 0L && Lector_Depurador.Position < Lector_Depurador.Length) { List <Excepciones> Lista_Excepciones = new List <Excepciones>(); for (long Índice = 8L; Índice < Lector_Depurador.Length;) { uint CRC32 = 0; DateTime Primera_Fecha = DateTime.MinValue; DateTime Última_Fecha = DateTime.MinValue; long Repeticiones = 0L; int Longitud = 0; string Mensaje = null; try { CRC32 = Lector_Depurador_Binario.ReadUInt32(); } catch { CRC32 = 0; } try { Primera_Fecha = DateTime.FromBinary(Lector_Depurador_Binario.ReadInt64()); } catch { Primera_Fecha = DateTime.MinValue; } try { Última_Fecha = DateTime.FromBinary(Lector_Depurador_Binario.ReadInt64()); } catch { Última_Fecha = DateTime.MinValue; } try { Repeticiones = Lector_Depurador_Binario.ReadInt64(); } catch { Repeticiones = 0L; } try { Longitud = Lector_Depurador_Binario.ReadInt32(); } catch { Longitud = 0; } try { Mensaje = Encoding.Unicode.GetString(Lector_Depurador_Binario.ReadBytes(Longitud)); } catch { Mensaje = "Unknown error."; } Depurador_Errores += Repeticiones; Depurador_Errores_Únicos++; Lista_Excepciones.Add(new Excepciones(CRC32, Primera_Fecha, Última_Fecha, Repeticiones, Longitud, Mensaje)); Índice += 32 + Longitud; } if (Lista_Excepciones.Count > 0) { Lista_Excepciones.Sort(new Comparador_Excepciones()); if (Invertir_Orden) { Lista_Excepciones.Reverse(); } for (int Índice = 0; Índice < Lista_Excepciones.Count; Índice++) { Texto += "[" + (Índice + 1).ToString() + "] [x" + Program.Traducir_Número(Lista_Excepciones[Índice].Repeticiones) + /*"] [CRC-32: " + Program.Traducir_Número(Lista_Excepciones[Índice].CRC32) + */ "] [" + Program.Traducir_Fecha_Hora(Lista_Excepciones[Índice].Primera_Fecha) + "] [" + Program.Traducir_Fecha_Hora(Lista_Excepciones[Índice].Última_Fecha) + "] " + Lista_Excepciones[Índice].Mensaje + "\r\n\r\n"; } } } this.Text = "Exception Debugger by Jupisoft - [Errors: " + Program.Traducir_Número(Depurador_Errores) + ", Unique Errors: " + Program.Traducir_Número(Depurador_Errores_Únicos) + "]"; if (!string.IsNullOrEmpty(Texto)) { Texto = "[Dear " + Program.Texto_Usuario + " if you want to help with the debugging of these exceptions, please send the \"Debugger\" file to: [email protected]]\r\n\r\n" + Texto.TrimEnd("\r\n\r\n".ToCharArray()); } Editor_RTF.Text = Texto; } } catch (Exception Excepción) { Depurador.Escribir_Excepción(Excepción != null ? Excepción.ToString() : null); } }
internal static string Traducir_Tamaño_Bytes_Automático(long Tamaño_Bytes, int Decimales, bool Decimales_Cero) { try { decimal Valor = (decimal)Tamaño_Bytes; int Índice = 0; for (; Índice < 7; Índice++) { if (Valor < 1024m) { break; } else { Valor = Valor / 1024m; } } string Texto = Traducir_Número(Math.Round(Valor, Decimales, MidpointRounding.AwayFromZero)); if (Decimales_Cero) { if (!Texto.Contains(Caracter_Coma_Decimal.ToString())) { Texto += ',' + new string('0', Decimales); } else { Decimales = Decimales - (Texto.Length - (Texto.IndexOf(Caracter_Coma_Decimal) + 1)); if (Decimales > 0) { Texto += new string('0', Decimales); } } } if (Índice == 0) { Texto += Tamaño_Bytes == 1L ? " Byte" : " Bytes"; } else if (Índice == 1) { Texto += " KB"; } else if (Índice == 2) { Texto += " MB"; } else if (Índice == 3) { Texto += " GB"; } else if (Índice == 4) { Texto += " TB"; } else if (Índice == 5) { Texto += " PB"; } else if (Índice == 6) { Texto += " EB"; } return(Texto); } catch (Exception Excepción) { Depurador.Escribir_Excepción(Excepción != null ? Excepción.ToString() : null); } return("? Bytes"); }