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");
}
站长苏飞 发表于 2016-9-1 10:18
没带登录的Cookie吧
站长苏飞 发表于 2016-9-1 11:23
你确定图片的网址是对的,那还是要带上Cookie测试一下的。看你上面的包没有问题
看协议加这个试试
站长苏飞 发表于 2016-9-1 14:17
应该还是Cookie的原因。这个具体原因不太好一一列举,需要尝试,你这个应该不允许外网访问吧。
lexlin 发表于 2016-9-1 14:44
我发给你的是可以外网访问的,有时间帮我看下!麻烦了
欢迎光临 苏飞论坛 (http://www.sufeinet.com/) | Powered by Discuz! X3.4 |