Hello Dave,
I think the problem you meet is is due to the server-side web
application/page is using Forms Authentication, the httpwebrequest based
programmatic http web requesting does not support interactive with forms
authentication. Forms Authentication always require an interactive client
user. There does exists means to programmatically request pages secured
through forms authentication, you can construct a http post message with
the username/password forms data pair and send it to the login page, after
that hold the returned cookie collection so that you can use httpwebrequest
to access other pages secured by the forms authentication later. here is a
good web article demonstrate on this:
http://odetocode.com/Articles/162.aspx
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.