Results 1 to 2 of 2

Thread: Best way to check if FTP is online/offline

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2013
    Posts
    8

    Best way to check if FTP is online/offline

    Hi, what is the best way to determine if a ftp server is online or offline in vb
    i have tried many different ways of pinging the ftp server, for example:

    Code:
            Dim objPing As New Ping()
    
            Try
                Dim objReply As PingReply = objPing.Send("ftp://servername.com/", 1000)
    
                If objReply.Status = IPStatus.Success Then
                    Label1.Text = String.Format("<b>Success</b> - IP Address:{0} Time:{1}ms", objReply.Address, objReply.RoundtripTime)
                Else
                    Label1.Text = objReply.Status.ToString()
                End If
            Catch ex As Exception
                Label1.Text = ex.Message
            End Try
    But whatever i try i get this error: "An exception occurred during a Ping request."

  2. #2
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: Best way to check if FTP is online/offline

    There is no point in doing a ping before Trying the FTP request.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width