G
Guest
When using the WebClient class, if you add a querystring parameter containing a pound sign ("#"), the WebClient class will fail to include the pound sign as well as everything else that should be included in the querystring following the pound sign. The following code illustrates the problem. Can anyone verify whether this is a bug in the Microsoft .NET Framework?
Dim client As New System.Net.WebClient
Dim q As System.Collections.Specialized.NameValueCollection = client.QueryString
q.Add("test1", "abc d.e")
q.Add("test2", "x#z")
q.Add("test3", "123")
client.UploadValues("http://localhost/a.aspx", q)
To verify, replace "localhost" above with a web server which logs incoming web hits including querystrings or with a web sever to which you can sniff TCP/IP packets.
Dim client As New System.Net.WebClient
Dim q As System.Collections.Specialized.NameValueCollection = client.QueryString
q.Add("test1", "abc d.e")
q.Add("test2", "x#z")
q.Add("test3", "123")
client.UploadValues("http://localhost/a.aspx", q)
To verify, replace "localhost" above with a web server which logs incoming web hits including querystrings or with a web sever to which you can sniff TCP/IP packets.