CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2013

    test establish ssh connection


    may someone help me

    i just wanna do simple code via vb6 to test ssh connection what i mean it is like i have server for ex. user test pass test

    i wanna check if the server able to establish ssh connection? if yes write 1 if not write 0 on flat file as .txt

    1 means online
    0 means offline

    note: no ping or nslookup as they're disabled for security purpose by admin.

  2. #2
    Join Date
    Aug 2011

    Re: test establish ssh connection

    Try copying a file test.txt (empty) using File System Object and capture the error.
    Here is a sample code:

    Private Function Server_Test()
    Dim fs As New FileSystemObject
    On Error GoTo errH

    ' FolderName must exist on user computer
    fs.CopyFile App.Path & "\test.txt" ,\\\FolderName\test.txt"

    'If the connection succeded, delete the file "test.txt"

    MsgBox "Server is Running"

    Exit Function
    MsgBox "Server is Stop"
    End Function

    usually the error code is #76 (Path not found)

    course can develop as Boolean function:
    Private Function Server_Test() As Boolean

    and the code of the function call looks like this:
    (somewhere in the application)
    If Not Server_Test
    do something...
    do something else...
    End If

    I hope you are a good starting point

Posting Permissions

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

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.