diff --git a/bin/MataSharp.dll b/bin/MataSharp.dll index a4361f6..7aa81a7 100644 Binary files a/bin/MataSharp.dll and b/bin/MataSharp.dll differ diff --git a/src/MataSharp/HTTPClient.cs b/src/MataSharp/HTTPClient.cs index 909e06b..28895bb 100644 --- a/src/MataSharp/HTTPClient.cs +++ b/src/MataSharp/HTTPClient.cs @@ -38,7 +38,14 @@ public void Put(string URL, string Data) public string Post(string URL, NameValueCollection Values) { - byte[] tmpArr = this.Client.UploadValues(URL, Values); + byte[] tmpArr = null; + try { tmpArr = this.Client.UploadValues(URL, Values); } + catch(WebException e) + { + if (((HttpWebResponse)e.Response).StatusCode == HttpStatusCode.Unauthorized) + throw new System.Security.Authentication.AuthenticationException("Wrong username and/or password."); + else throw e; + } return stripString(Encoding.ASCII.GetString(tmpArr)); } diff --git a/src/MataSharp/bin/Release/MataSharp.dll b/src/MataSharp/bin/Release/MataSharp.dll index a4361f6..7aa81a7 100644 Binary files a/src/MataSharp/bin/Release/MataSharp.dll and b/src/MataSharp/bin/Release/MataSharp.dll differ diff --git a/src/MataSharp/bin/Release/MataSharp.pdb b/src/MataSharp/bin/Release/MataSharp.pdb index 65ec6c5..39fa5f2 100644 Binary files a/src/MataSharp/bin/Release/MataSharp.pdb and b/src/MataSharp/bin/Release/MataSharp.pdb differ diff --git a/src/MataSharp/obj/Release/MataSharp.dll b/src/MataSharp/obj/Release/MataSharp.dll index a4361f6..7aa81a7 100644 Binary files a/src/MataSharp/obj/Release/MataSharp.dll and b/src/MataSharp/obj/Release/MataSharp.dll differ diff --git a/src/MataSharp/obj/Release/MataSharp.pdb b/src/MataSharp/obj/Release/MataSharp.pdb index 65ec6c5..39fa5f2 100644 Binary files a/src/MataSharp/obj/Release/MataSharp.pdb and b/src/MataSharp/obj/Release/MataSharp.pdb differ diff --git a/src/MataTest/Program.cs b/src/MataTest/Program.cs index 0cddb25..cc88ade 100644 --- a/src/MataTest/Program.cs +++ b/src/MataTest/Program.cs @@ -15,7 +15,7 @@ static void Main(string[] args) var schools = MagisterSchool.GetSchools(Console.ReadLine()); for (int i = 0; i < schools.Count; i++) - Console.WriteLine(i + ": " + schools[i].Name + " " + schools[i].URL); + Console.WriteLine(i + ": " + schools[i].ToString()); MagisterSchool school = schools[Convert.ToInt32(Console.ReadLine())]; #endregion diff --git a/src/MataTest/bin/Debug/MataSharp.dll b/src/MataTest/bin/Debug/MataSharp.dll index a4361f6..7aa81a7 100644 Binary files a/src/MataTest/bin/Debug/MataSharp.dll and b/src/MataTest/bin/Debug/MataSharp.dll differ diff --git a/src/MataTest/bin/Debug/MataSharp.pdb b/src/MataTest/bin/Debug/MataSharp.pdb index 65ec6c5..39fa5f2 100644 Binary files a/src/MataTest/bin/Debug/MataSharp.pdb and b/src/MataTest/bin/Debug/MataSharp.pdb differ diff --git a/src/MataTest/bin/Debug/MataTest.exe b/src/MataTest/bin/Debug/MataTest.exe index b39d06e..b8fc883 100644 Binary files a/src/MataTest/bin/Debug/MataTest.exe and b/src/MataTest/bin/Debug/MataTest.exe differ diff --git a/src/MataTest/bin/Debug/MataTest.pdb b/src/MataTest/bin/Debug/MataTest.pdb index a2b1fa2..2446434 100644 Binary files a/src/MataTest/bin/Debug/MataTest.pdb and b/src/MataTest/bin/Debug/MataTest.pdb differ diff --git a/src/MataTest/obj/Debug/MataTest.csprojResolveAssemblyReference.cache b/src/MataTest/obj/Debug/MataTest.csprojResolveAssemblyReference.cache index 9845d5b..72230a9 100644 Binary files a/src/MataTest/obj/Debug/MataTest.csprojResolveAssemblyReference.cache and b/src/MataTest/obj/Debug/MataTest.csprojResolveAssemblyReference.cache differ diff --git a/src/MataTest/obj/Debug/MataTest.exe b/src/MataTest/obj/Debug/MataTest.exe index b39d06e..b8fc883 100644 Binary files a/src/MataTest/obj/Debug/MataTest.exe and b/src/MataTest/obj/Debug/MataTest.exe differ diff --git a/src/MataTest/obj/Debug/MataTest.pdb b/src/MataTest/obj/Debug/MataTest.pdb index a2b1fa2..2446434 100644 Binary files a/src/MataTest/obj/Debug/MataTest.pdb and b/src/MataTest/obj/Debug/MataTest.pdb differ