[RESOLVED] Whats the best way to:

Updating a program that uses the vb6 Inet Control, to POST to a site, and retrieve info. I ran the VB.Net Wizard, and it produced a working program. ;)

It's still using the VB6 namespace. I was looking into REMOTING, but it seems to only connect thru a Channel to another Channel.

If I don't have a channel listening, how would I connect to a web server over port 80?

I am going to create threads to do the searches, but I'm not sure which control would work the same way.

I suppose I could use the namespace, but I really want some Net speeds :)
[599 byte] By [dglienna] at [2007-11-20 11:38:57]
# 1 Re: [RESOLVED] Whats the best way to:
I'm not sure I understand your question, but if you need way to post/receive data from a web server you can use the WebClient (http://msdn2.microsoft.com/en-us/library/system.net.webclient(VS.80).aspx) or HttpWebRequest (http://msdn2.microsoft.com/en-us/library/system.net.httpwebrequest.aspx) class.

- petter
wildfrog at 2007-11-10 3:08:15 >
# 2 Re: [RESOLVED] Whats the best way to:
I simulate clicking the SEND button, and supply a POST with parameters and a header. Would I just pass the POST here?

Imports System
Imports System.Net
Imports System.IO

Public Class Test

Public Shared Sub Main(args() As String)
If args Is Nothing OrElse args.Length = 0 Then
Throw New ApplicationException("Specify the URI of the resource to retrieve.")
End If
Dim client As New WebClient()

' Add a user agent header in case the
' requested URI contains a query.
client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)")

Dim data As Stream = client.OpenRead(args(0))
Dim reader As New StreamReader(data)
Dim s As String = reader.ReadToEnd()
Console.WriteLine(s)
data.Close()
reader.Close()
End Sub 'Main
End Class 'Test
dglienna at 2007-11-10 3:09:18 >