webclient file check / http 파일 체크

      Try

            Dim request As WebRequest = WebRequest.Create("http://url/1.exe")

            request.Credentials = CredentialCache.DefaultCredentials

            Dim response As WebResponse = request.GetResponse()

            MsgBox("ok")

        Catch ex As Exception

            MsgBox("err")

        End Try

이 게시물을

댓글'1'
VNote (작성자)
  • 2019.12.09
  • 수정: 2019.12.09 14:59:14

        Dim webRequest As System.Net.WebRequest = System.Net.WebRequest.Create("http://url/1.txt")

        webRequest.Method = "HEAD"

        Try

            Dim response As System.Net.HttpWebResponse = CType(webRequest.GetResponse, System.Net.HttpWebResponse)

            If (response.StatusCode.ToString = "OK") Then

                MsgBox("ok")

            End If

 

        Catch

            MsgBox("err")

        End Try

이 댓글을

공유하기

SEARCH

MENU NAVIGATION