Passing Byte (VB.NET)
Posted
by yae
on Stack Overflow
See other posts from Stack Overflow
or by yae
Published on 2010-04-27T21:49:02Z
Indexed on
2010/04/27
21:53 UTC
Read the original article
Hit count: 314
Hi
I need to pass encoded string to php page.
To convert string to iso:
Dim result As Byte() = Encoding.Convert(Encoding.UTF8, Encoding.GetEncoding("iso-8859-1"), input)
I have this code to pass string, but how I must do it to pass Byte (variable result) instead of the string (variable MyVarString)?
Dim client As WebClient
Dim data As Stream
Dim reader As StreamReader
Dim baseurl As String
baseurl = "http://example.com/api/mypage2.php"
client = New WebClient
client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)")
client.QueryString.Add("mensaje", MyVarString)
data = client.OpenRead(baseurl)
reader = New StreamReader(data)
s = reader.ReadToEnd()
data.Close()
reader.Close()
Etc.
© Stack Overflow or respective owner