Menu

adapting code for use with Visual Basic

Jet BLack
2014-01-24
2014-01-29
  • Jet BLack

    Jet BLack - 2014-01-24

    I am trying to write a simple file upload/download for communication with an sftp server. looking at the sharpsshtransfertests.cs routine, the lines I cannot figure out are:

    sshCp.OnTransferStart += new FileTransferEvent(sshCp_OnTransferStart);
    sshCp.OnTransferProgress += new FileTransferEvent(sshCp_OnTransferProgress);
    sshCp.OnTransferEnd += new FileTransferEvent(sshCp_OnTransferEnd);

    I am not familiar with c# so I don't understand the syntax or how to convert it to vb.net

    any help would be appreciated

     
  • jed spraul

    jed spraul - 2014-01-29

    You are more likely to get help using a library that is updated semi-regularly, such as: https://sshnet.codeplex.com/discussions

    I went to http://www.developerfusion.com/tools/convert/csharp-to-vb/ and it converted the code to VB as follows:

    sshCp.OnTransferStart += New FileTransferEvent(AddressOf sshCp_OnTransferStart)
    sshCp.OnTransferProgress += New FileTransferEvent(AddressOf sshCp_OnTransferProgress)
    sshCp.OnTransferEnd += New FileTransferEvent(AddressOf sshCp_OnTransferEnd)

     

Log in to post a comment.