如果是WebException

时间:2015-02-19 22:36:07

标签: vb.net webclient

使用以下代码:

            Dim address2 As String = "blablabla"
            Dim client2 As WebClient = New WebClient()
            Dim reader2 As StreamReader = New StreamReader(client2.OpenRead(address2))
            Dim json2 As JObject = JObject.Parse(reader2.ReadToEnd)
            If FlatLabel4.Text = "Nível: 30" Then

我希望他,如果"远程服务器返回错误:(404)Not Found。",它会做某事。

我该怎么做?

感谢。

0 个答案:

没有答案