Converted project to VisualStudio 2012.
Adding SoundGraphDisplay and SensorFrontView classes.
They were respectively based on SystemTray and SensorNotifyIcon.
SoundGraphDisplay is now able to load iMONDisplay.dll providing it lives on your PATH.
Adding option to sensor context menu for adding it into FrontView.
3 This Source Code Form is subject to the terms of the Mozilla Public
4 License, v. 2.0. If a copy of the MPL was not distributed with this
5 file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 Copyright (C) 2009-2010 Michael Möller <mmoeller@openhardwaremonitor.org>
16 using System.Windows.Forms;
18 namespace OpenHardwareMonitor.GUI {
19 public partial class CrashForm : Form {
21 private Exception exception;
24 InitializeComponent();
27 public Exception Exception {
28 get { return exception; }
31 StringBuilder s = new StringBuilder();
32 Version version = typeof(CrashForm).Assembly.GetName().Version;
33 s.Append("Version: "); s.AppendLine(version.ToString());
35 s.AppendLine(exception.ToString());
37 if (exception.InnerException != null) {
38 s.AppendLine(exception.InnerException.ToString());
41 s.Append("Common Language Runtime: ");
42 s.AppendLine(Environment.Version.ToString());
43 s.Append("Operating System: ");
44 s.AppendLine(Environment.OSVersion.ToString());
45 s.Append("Process Type: ");
46 s.AppendLine(IntPtr.Size == 4 ? "32-Bit" : "64-Bit");
47 reportTextBox.Text = s.ToString();
51 private void sendButton_Click(object sender, EventArgs e) {
53 Version version = typeof(CrashForm).Assembly.GetName().Version;
54 WebRequest request = WebRequest.Create(
55 "http://openhardwaremonitor.org/report.php");
56 request.Method = "POST";
57 request.Timeout = 5000;
58 request.ContentType = "application/x-www-form-urlencoded";
62 "version=" + Uri.EscapeDataString(version.ToString()) + "&" +
63 "report=" + Uri.EscapeDataString(reportTextBox.Text) + "&" +
64 "comment=" + Uri.EscapeDataString(commentTextBox.Text) + "&" +
65 "email=" + Uri.EscapeDataString(emailTextBox.Text);
66 byte[] byteArray = Encoding.UTF8.GetBytes(report);
67 request.ContentLength = byteArray.Length;
70 Stream dataStream = request.GetRequestStream();
71 dataStream.Write(byteArray, 0, byteArray.Length);
74 WebResponse response = request.GetResponse();
75 dataStream = response.GetResponseStream();
76 StreamReader reader = new StreamReader(dataStream);
77 string responseFromServer = reader.ReadToEnd();
83 } catch (WebException) {
84 MessageBox.Show("Sending the crash report failed.", "Error",
85 MessageBoxButtons.OK, MessageBoxIcon.Error);