|
楼主 |
发表于 2014-6-26 00:06:53
|
显示全部楼层
本帖最后由 sunny 于 2014-6-26 00:09 编辑
搞定了,谢谢两位!
几个参数都必须加上才行:
string url = "http://192.168.1.1/userRpm/SysRebootRpm.htm?Reboot=%D6%D8%C6%F4%C2%B7%D3%C9%C6%F7";
Uri uri = new Uri(url);
var cache = new CredentialCache();
cache.Add(uri, "Basic", new NetworkCredential("admin", "admin"));
DotNet4.Utilities.HttpItem item = new DotNet4.Utilities.HttpItem
{
URL = url,
Host = "192.168.1.1",
Referer = "http://192.168.1.1/userRpm/SysRebootRpm.htm",
ContentType = "text/html;charset=gb2312",
Cookie = "Authorization: Basic YWRtaW46YWRtaW4=",
ICredentials = cache
};
DotNet4.Utilities.HttpHelper http = new DotNet4.Utilities.HttpHelper();
DotNet4.Utilities.HttpResult html = http.GetHtml(item);
|
|