Replaced HttpUtility.UrlEncode with Uri.EscapeDataString and deleted the reference to the System.Web assembly. The System.Web assembly seems to be missing on some .NET 4.0 installations (and the overhead of using it is a bit large, just for the UrlEncode method).

This commit is contained in:
Michael Möller
2010-10-02 18:15:46 +00:00
parent d0f3c634d6
commit f078c78c22
3 changed files with 10 additions and 18 deletions
+5 -9
View File
@@ -36,13 +36,9 @@
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Net;
using System.Text;
using System.Web;
using System.Windows.Forms;
namespace OpenHardwareMonitor.GUI {
@@ -88,11 +84,11 @@ namespace OpenHardwareMonitor.GUI {
request.ContentType = "application/x-www-form-urlencoded";
string report =
"type=crash&" +
"version=" + HttpUtility.UrlEncode(version.ToString()) + "&" +
"report=" + HttpUtility.UrlEncode(reportTextBox.Text) + "&" +
"comment=" + HttpUtility.UrlEncode(commentTextBox.Text) + "&" +
"email=" + HttpUtility.UrlEncode(emailTextBox.Text);
"type=crash&" +
"version=" + Uri.EscapeDataString(version.ToString()) + "&" +
"report=" + Uri.EscapeDataString(reportTextBox.Text) + "&" +
"comment=" + Uri.EscapeDataString(commentTextBox.Text) + "&" +
"email=" + Uri.EscapeDataString(emailTextBox.Text);
byte[] byteArray = Encoding.UTF8.GetBytes(report);
request.ContentLength = byteArray.Length;
+5 -8
View File
@@ -36,13 +36,10 @@
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Net;
using System.Text;
using System.Web;
using System.Windows.Forms;
namespace OpenHardwareMonitor.GUI {
@@ -76,11 +73,11 @@ namespace OpenHardwareMonitor.GUI {
request.ContentType = "application/x-www-form-urlencoded";
string report =
"type=hardware&" +
"version=" + HttpUtility.UrlEncode(version.ToString()) + "&" +
"report=" + HttpUtility.UrlEncode(reportTextBox.Text) + "&" +
"comment=" + HttpUtility.UrlEncode(commentTextBox.Text) + "&" +
"email=" + HttpUtility.UrlEncode(emailTextBox.Text);
"type=hardware&" +
"version=" + Uri.EscapeDataString(version.ToString()) + "&" +
"report=" + Uri.EscapeDataString(reportTextBox.Text) + "&" +
"comment=" + Uri.EscapeDataString(commentTextBox.Text) + "&" +
"email=" + Uri.EscapeDataString(emailTextBox.Text);
byte[] byteArray = Encoding.UTF8.GetBytes(report);
request.ContentLength = byteArray.Length;
-1
View File
@@ -61,7 +61,6 @@
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Management" />
<Reference Include="System.Web" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="Aga.Controls, Version=1.7.0.0, Culture=neutral, PublicKeyToken=fcc90fbf924463a3">