Browse Source

Encode password characters on translation server post.

Passwords with non-alphanumeric characters were rejected because they were not encoded in the http post body.
pull/28/head
Matt Ward 13 years ago
parent
commit
9f7add68d5
  1. 1
      src/Tools/StringResourceTool/StringResourceTool.csproj
  2. 3
      src/Tools/StringResourceTool/TranslationServer.cs

1
src/Tools/StringResourceTool/StringResourceTool.csproj

@ -44,6 +44,7 @@
</Reference> </Reference>
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq"> <Reference Include="System.Xml.Linq">

3
src/Tools/StringResourceTool/TranslationServer.cs

@ -8,6 +8,7 @@
using System; using System;
using System.IO; using System.IO;
using System.Net; using System.Net;
using System.Web;
using System.Windows.Forms; using System.Windows.Forms;
namespace StringResourceTool namespace StringResourceTool
@ -28,7 +29,7 @@ namespace StringResourceTool
System.Threading.Thread.Sleep(50); System.Threading.Thread.Sleep(50);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(baseURL + "logon.asp"); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(baseURL + "logon.asp");
request.ContentType = "application/x-www-form-urlencoded"; request.ContentType = "application/x-www-form-urlencoded";
string postString = "uname=" + user + "&upwd=" + pwd; string postString = "uname=" + user + "&upwd=" + HttpUtility.UrlEncode(pwd);
request.ContentLength = postString.Length; request.ContentLength = postString.Length;
request.CookieContainer = cookieContainer; request.CookieContainer = cookieContainer;
request.Method = "POST"; request.Method = "POST";

Loading…
Cancel
Save