Improved the stability of the crash reporting system.

This commit is contained in:
Michael Möller 2010-04-25 19:05:15 +00:00
parent 426938de54
commit 98c7c31cac
3 changed files with 16 additions and 9 deletions

View File

@ -79,7 +79,7 @@ namespace OpenHardwareMonitor.GUI {
WebRequest request = WebRequest.Create(
"http://openhardwaremonitor.org/report.php");
request.Method = "POST";
request.Timeout = 3000;
request.Timeout = 5000;
request.ContentType = "application/x-www-form-urlencoded";
string report =
@ -89,10 +89,11 @@ namespace OpenHardwareMonitor.GUI {
byte[] byteArray = Encoding.UTF8.GetBytes(report);
request.ContentLength = byteArray.Length;
Stream dataStream = request.GetRequestStream();
dataStream.Write(byteArray, 0, byteArray.Length);
dataStream.Close();
try {
Stream dataStream = request.GetRequestStream();
dataStream.Write(byteArray, 0, byteArray.Length);
dataStream.Close();
WebResponse response = request.GetResponse();
dataStream = response.GetResponseStream();
StreamReader reader = new StreamReader(dataStream);
@ -100,10 +101,13 @@ namespace OpenHardwareMonitor.GUI {
reader.Close();
dataStream.Close();
response.Close();
Close();
} catch (WebException) {
MessageBox.Show("Sending the crash report failed.", "Error",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
} finally {
Close();
} catch {
}
}
}

View File

@ -91,7 +91,10 @@ namespace OpenHardwareMonitor {
Exception e = args.ExceptionObject as Exception;
if (e != null)
ReportException(e);
} catch { }
} catch {
} finally {
Environment.Exit(0);
}
}
}
}

View File

@ -69,5 +69,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.1.30.0")]
[assembly: AssemblyFileVersion("0.1.30.0")]
[assembly: AssemblyVersion("0.1.31.0")]
[assembly: AssemblyFileVersion("0.1.31.0")]