我有这个wget请求:
wget --http-user="user" --http-passwd="password"
www.example.com
Run Code Online (Sandbox Code Playgroud)
在http请求中我写了url地址,但我不知道在哪里放入登录iformation.谢谢
怎么样:
string page;
using(var client = new WebClient()) {
client.Credentials = new NetworkCredential("user", "password");
page = client.DownloadString("http://www.example.com/");
}
Run Code Online (Sandbox Code Playgroud)
?
| 归档时间: |
|
| 查看次数: |
5319 次 |
| 最近记录: |