回1楼,结合StatusCode使用即可
httprequest
Select Case e.Path
Case "test.htm"
e.Response.StatusCode = "404"
e.WriteString("")
End Select
客户端调用
Dim hc As New HttpClient("http://127.0.0.1/test.htm")
hc.SkipError = True
If hc.GetFile("c:\data\123.jpg") Then
MessageBox.show("文件下载成功","提示")
Else
MessageBox.show("文件下载失败","提示")
End If
Output.Show("hc.StatusCode=" & hc.StatusCode)
回2楼,我测试SkipError 是有效的
Dim hc As New HttpClient("http://127.0.0.1/test.htm")
hc.SkipError = True
hc.GetData
Output.Show("hc.StatusCode=" & hc.StatusCode)