Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Renci SSH Problem

Renci SSH Problem

Scheduled Pinned Locked Moved Visual Basic
perlhelp
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    ToxicF3AR
    wrote on last edited by
    #1

    Hello Friend I am making a GUI for my vpn in visual basic and I am getting a problem when I am using ("perl something.pl" + somehting + something1 + something2) but when I am using ("perl something.pl something1value something2value") everything is working fine any solution please Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim IP As String = "xxx.xxx.xxx.xxx" Dim Username As String = "root" Dim Password As String = "mypassword" Dim cmd As Renci.SshNet.SshCommand Dim connInfo As New Renci.SshNet.PasswordConnectionInfo(IP, Username, Password) Dim sshClient As New Renci.SshNet.SshClient(connInfo) Dim something As String = TextBox1.Text Dim something1 As String = TextBox2.Text Dim something2 As String = TextBox3.Text sshClient.Connect() cmd = sshClient.RunCommand("perl something.pl" +something + something1 + something2) Label1.Text = cmd.Result End Sub End Class

    D 1 Reply Last reply
    0
    • T ToxicF3AR

      Hello Friend I am making a GUI for my vpn in visual basic and I am getting a problem when I am using ("perl something.pl" + somehting + something1 + something2) but when I am using ("perl something.pl something1value something2value") everything is working fine any solution please Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim IP As String = "xxx.xxx.xxx.xxx" Dim Username As String = "root" Dim Password As String = "mypassword" Dim cmd As Renci.SshNet.SshCommand Dim connInfo As New Renci.SshNet.PasswordConnectionInfo(IP, Username, Password) Dim sshClient As New Renci.SshNet.SshClient(connInfo) Dim something As String = TextBox1.Text Dim something1 As String = TextBox2.Text Dim something2 As String = TextBox3.Text sshClient.Connect() cmd = sshClient.RunCommand("perl something.pl" +something + something1 + something2) Label1.Text = cmd.Result End Sub End Class

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      All of your textbox values are being smashed together. If the user types param1 in TextBox1 and param2 in TextBox2, your command line will look like this:

      perl something.plparam1param2
      

      You're not putting spaces between the command line parameters.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak

      T 1 Reply Last reply
      0
      • D Dave Kreskowiak

        All of your textbox values are being smashed together. If the user types param1 in TextBox1 and param2 in TextBox2, your command line will look like this:

        perl something.plparam1param2
        

        You're not putting spaces between the command line parameters.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak

        T Offline
        T Offline
        ToxicF3AR
        wrote on last edited by
        #3

        I appreciate your help but how to put spaces them because if I am giving spaces between the commands they are getting back in from once again.

        L 1 Reply Last reply
        0
        • T ToxicF3AR

          I appreciate your help but how to put spaces them because if I am giving spaces between the commands they are getting back in from once again.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          cmd = sshClient.RunCommand("perl something.pl " + something + " " + something1 + " " something2)

          Use the best guess

          T 1 Reply Last reply
          0
          • L Lost User

            cmd = sshClient.RunCommand("perl something.pl " + something + " " + something1 + " " something2)

            Use the best guess

            T Offline
            T Offline
            ToxicF3AR
            wrote on last edited by
            #5

            Thanks my problem is fixed now :)

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups