Try
Dim oWeb As New System.Net.WebClient()
oWeb.Headers.Add("Content-Type", "application/x-www-form-urlencoded")
Dim bytArguments As Byte() = System.Text.Encoding.ASCII.GetBytes("q=InTheory")
Dim bytRetData As Byte() = oWeb.UploadData("http://www.google.com/search", "GET", bytArguments)
Debug.Write(System.Text.Encoding.ASCII.GetString(bytRetData))
Catch ex As Exception
MsgBox(ex.Message)
End Try
Sera el parametro bytArguments
no se....
pero el try y el catch no lleva {}
try{
}
catch(exception ex){
}
Cita de: l Galo l en 28 Mayo 2012, 09:47 AM
no se....
pero el try y el catch no lleva {}
try{
}
catch(exception ex){
}
Pero en .net no se utilizan las { } no? ._.
yo en C# las uso.
La sintaxis esta bien, el problema esta en algun parametro o algo falta en ese codigo...
Si alguien tuviera algun code para pasar por POST se lo voy agradecer...
Salu2
no hagas POST, directamente descarga el codigo fuente de la direccion completa.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim c As New System.Net.WebClient()
Dim response() As Byte = c.DownloadData("http://www.google.com/search?q=InTheory")
MessageBox.Show(System.Text.Encoding.UTF8.GetString(response))
End Sub
saludos.