Workaround here, do not repeat, Portal: http://stackoverflow.com/questions/856885/httpwebrequest-to-url-with-dot-at-the-end
Workaround:
/// <summary> ///pass the pending URL for processing/// </summary> /// <param name= "Oldurl" >pending URL</param> /// <returns>the URL after processing</returns> Public Static stringUrlfix (stringOldurl) { varURL =NewUri (Oldurl); MethodInfo Getsyntax=typeof(UriParser). GetMethod ("Getsyntax", System.Reflection.BindingFlags.Static |System.Reflection.BindingFlags.NonPublic); FieldInfo Flagsfield=typeof(UriParser). GetField ("M_flags", System.Reflection.BindingFlags.Instance |System.Reflection.BindingFlags.NonPublic); if(Getsyntax! =NULL&& Flagsfield! =NULL) { foreach(stringSchemeinch New[] {"http","HTTPS"}) {UriParser parser= (UriParser) Getsyntax.invoke (NULL,New Object[] {scheme}); if(Parser! =NULL) { intFlagsvalue = (int) Flagsfield.getvalue (parser); if((Flagsvalue &0x1000000) !=0) Flagsfield.setvalue (parser, Flagsvalue& ~0x1000000); }}} URL=NewUri (Oldurl); returnURL. ToString (); }
In addition this bug has been resolved in. net4.5!
URL with. At the end, Microsoft will have a bug when reading with HttpWebRequest ...