I see different versions of the constructor, one uses info from web.config, one specifies the host, and one the host and port. But how do I set the username and password to
Use NetworkCredential
NetworkCredential
Yep, just add these two lines to your code.
var credentials = new System.Net.NetworkCredential("username", "password"); client.Credentials = credentials;