Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
{
"attachmentTypeName":"",
"name":"附件2.jpg",
"path":"https://oss-wuliu.test.cnoocmall.com/V_TransportOrderShip/38142443/R4A2U6/%E9%99%84%E4%BB%B62.jpg?Expires=********&OSSAccessKeyId=********&Signature=**********",
"uploadTime":"2024-05-29 11:24:07"
},
然后我写了以下代码,以获取下载文件
Dim hc As New HttpClient("path")
If hc.GetFile("C:\wlxtdownloaddata\" & "name") Then
MessageBox.show("文件下载成功", "提示")
Else
MessageBox.show("文件下载失败", "提示")
Return '终止代码的执行
End If
执行后,提示:基础连接已经关闭: 连接被意外关闭
请问该如何修改代码来下载文件?不胜感激
String FILE_NAME = "E:/桌面/testDownlaod.jpg";
String url = "https://oss-wuliu.test.cnoocmall.com/V_TransportOrderShip/38142443/R4A2U6/%E9%99%84%E4%BB%B61.jpg?*************";
InputStream In = New URL(url).openStream();
Files.copy(In, Paths.get(FILE_NAME), StandardCopyOption.REPLACE_EXISTING);