webclient folder check / http 폴더 체크
*
OPTIONS : 요청 URI에서 사용할 수 있는 Method를 물어본다.(스펙 참고)
◾GET : 요청 URI의 정보를 가져온다.(스펙 참고)
◾HEAD : GET 요청에서 body는 제외하고 헤더만 가져온다.(스펙 참고)
◾POST : 요청 URI의 리소스의 새로운 정보를 보낸다.(스펙 참고)
◾PUT : 요청 URI에 저장될 정보를 보낸다. (스펙 참고)
◾DELETE : 요청 URI의 리소스를 삭제한다.(스펙 참고)
◾TRACE : 보낸 메시지를 다시 돌려보낸다. (스펙 참고)
◾CONNECT : 프록시에 사용하기 위해 예약된 메서드이다.(스펙 참고)

        Try

            Dim client As WebClient = New WebClient()

            '  client.Credentials = CredentialCache.DefaultCredentials

            client.Credentials = New System.Net.NetworkCredential("id", "pass")

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

            request.Credentials = CredentialCache.DefaultCredentials

            request.Timeout = 1200

            request.Method = "HEAD"

            Dim response As HttpWebResponse = CType(request.GetResponse(), HttpWebResponse)

 

            If String.Compare(response.StatusDescription, "OK", True) = 0 Then

                MsgBox("ok")

            End If

        Catch

            MsgBox("err")

        End Try

이 게시물을

공유하기

SEARCH

MENU NAVIGATION