登录后的界面是这样的,点击登录后显示右边的图片
请求连接如下
结果
GET http://192.168.1.168/ISAPI/Syste ... 59:59?1472694653015 HTTP/1.1
Accept: */*
Referer: http://192.168.1.168/doc/page/application.asp
Accept-Language: zh-CN
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.2)
Accept-Encoding: gzip, deflate
Cookie: language=zh
Connection: Keep-Alive
Authorization: Digest username="admin",realm="iDS-2CD6124FWD-I/H",nonce="4d6a4e47524464474d4551365a5455794f5463785a57593d",uri="/ISAPI/System/Video/inputs/channels/1/heatMap/picture?starttime=2016-09-01T00:00:00&endtime=2016-09-01T23:59:59?1472694653015",cnonce="1cab7af3a15eb125b4a76c452283c483",nc=00000001,response="d1bd55179ee1416425b65b147037386b",qop="auth"
Host: 192.168.1.168
下面是我的代码
[C#] 纯文本查看 复制代码
public ActionResult Test()
{
HttpHelper hh = new HttpHelper();
HttpItem item = new HttpItem();
object currenttimemillis = (long)(DateTime.UtcNow - new DateTime(1970, 1, 1, 8, 0, 0, DateTimeKind.Utc)).TotalMilliseconds / 1000;
item.Referer = "http://192.168.1.168/doc/page/application.asp";
item.URL = "http://192.168.1.168/ISAPI/System/Video/inputs/channels/1/heatMap/picture?starttime=2016-08-30T00:00:00&endtime=2016-08-30T23:59:59?" + currenttimemillis.ToString();
item.Accept = "application/x-ms-application, image/jpeg, application/xaml+xml, image/gif, image/pjpeg, application/x-ms-xbap, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*";
item.UserAgent = "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.2)";
item.Host = "192.168.1.168";
item.Header.Add("Accept-Encoding", "gzip, deflate");
item.Header.Add("Authorization", "Digest username=\"admin\",realm=\"iDS-2CD6124FWD-I/H\",nonce=\"4d6a63344d4449304d5459365a5445324e574d304d54673d\",uri=\"/ISAPI/System/Video/inputs/channels/1/heatMap/picture?starttime=2016-08-29T00:00:00&endtime=2016-09-04T23:59:59?" + currenttimemillis.ToString() + "\",cnonce=\"" + Guid.NewGuid().ToString().Replace("-", "") + "\",nc=00000001,response=\"" + Guid.NewGuid().ToString().Replace("-", "") + "\",qop=\"auth\"");
item.ResultType = ResultType.Byte;
HttpResult hr = hh.GetHtml(item);
byte[] bytes = hr.ResultByte;
return File(bytes, @"image/jpeg");
}
返回码401
请问哪里配置得不对呢?
|