我有这个wget请求:
wget --http-user="user" --http-passwd="password"
www.example.com
在http请求中我写了url地址,但我不知道在哪里放入登录iformation。 谢谢
答案 0 :(得分:6)
怎么样:
string page;
using(var client = new WebClient()) {
client.Credentials = new NetworkCredential("user", "password");
page = client.DownloadString("http://www.example.com/");
}