|
- Dim http As New HttpHelper
- Dim item As New HttpItem()
- With item
- .Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
- .URL = strExcelUrl
- .Method = "get"
- .CerPath = strCapath
- .KeepAlive = True
- .Referer = strJYUrl
- .ContentType = "application/vnd.ms-excel"
- .Cookie = cookies
- End With
- result = http.GetHtml(item)
- File.WriteAllBytes("D:" + Now.ToString("yyMMddHHmmss") + ".xls", result.ResultByte)
复制代码 请老大百忙中看看,vb的代码。带证书和cookies下载一个xls文件,结果result.ResultByte没有数据,而result.html中是乱码。
群中有兄弟说是目标编码的问题,我设置为.ContentType = "application/vnd.ms-excel" ,问题依旧。把这项去掉,也是一样的结果。看http状态是200,应该是返回该文件,就是不知道为什么没在ResultByte里。求解惑!谢谢了!
|
|