Help! User-agent - how to identify yourself?

  • Thread starter Thread starter Thug Passion
  • Start date Start date
T

Thug Passion

Hi,

I've written a type of web spider; now I'd like it to identify itself
to servers it crawls over. I'm using VB.NET 2003, XP Home, and a
(desktop) Windows Forms app.

I'm using the WebClient class to send requess and open read streams.
The couple MSDN articles I've found on setting the UserAgent property
use a WebRequest & WebResponse pair. But they create a request, then
typecast it and set the UserAgent after they've already sent the
request to the server.

How can I identify myself *before* I set out into the web?

Thanks!




WebX = New WebClient
Try
ans = WebX.OpenRead(Site)
str = New System.IO.StreamReader(ans)
Catch ex As Exception
....
 
Back
Top