Hi!
I need to pass some strings via an HTTP POST from page1 (in my app) to
a page on another server.
I stored my data in a NameValueCollec tion and then sent it using
WebClient.Uploa dValues.
Everything works fine but if one of the string contains a european
character (čéňŕů...) it's not sent correctly and the char is received
as a '?'
I read at least 20 different posts on similiar problem but didn't find
a solution yet.
any help?
Giggi
This is the code:
Dim uriString As String = "http://aqua.altervista .org/
prova.php"
Dim myWebClient As New Net.WebClient()
Dim myNameValueColl ection As New NameValueCollec tion()
Dim MYTEXT As String = TextBox1.Text
Dim USER As String = TextBox2.Text
Dim responseArray As Byte()
Dim answer As String
' Add necessary parameter/value pairs to the name/value
container.
myNameValueColl ection.Add("TEX T", MYTEXT)
myNameValueColl ection.Add("USE R", USER)
'The Upload(String,N ameValueCollect ion)' method implicitly
sets the HTTP POST as the request method.
myWebClient.Cre dentials =
Net.CredentialC ache.DefaultCre dentials
responseArray = myWebClient.Upl oadValues(uriSt ring,
myNameValueColl ection)
'Decode the response.
answer= Encoding.ASCII. GetString(respo nseArray)