May 14th, 2013, 09:22 AM
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.
192.168.1.30 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.
May 15th, 2013, 05:08 AM
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" ,\\192.168.1.30\FolderName\test.txt"
'If the connection succeded, delete the file "test.txt"
MsgBox "Server is Running"
MsgBox "Server is Stop"
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 else...
I hope you are a good starting point
Click Here to Expand Forum to Full Width