• 24-01-2014, 13:27:55
    #1
    Üyeliği durduruldu
    merhabalar yardıma ihtiyacım var bir projemde ip kulanıcı adı şifre ve port olmak üzere 4 texbox tan oluşmakta bilgileri girinlince sadece baglantının açılmasını istiyorum tamir gal ile denedim ama yapamadım yardımcı olursanız sevinirim.
  • 24-01-2014, 15:02:37
    #2
    Merhaba,

    Nerede hata yaptınız tam olarak bilemiyorum ama bağlantı kodunu belirttiğiniz şekilde paylaşıyorum.

    Teşekkürler.

    public partial class Form1 : Form
        {
            static SshExec exec;
    
            public Form1()
            {
                InitializeComponent();
            }
    
            private void button1_Click(object sender, EventArgs e)
            {
                if (button1.Text == "Bağlan")
                {
                        try
                        {
    
                            exec = new SshExec(textBox1.Text, textBox2.Text, textBox3.Text);
                            exec.Connect(int.Parse(textBox4.Text));
    
                            if (exec.Connected == true)
                            {
                                MessageBox.Show("Bağlantı kuruldu");
                                button1.Text = "Bağlantıyı Kes";
                            }
    
                        }
    
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message);
                        }
                 }
    
                else if (button1.Text == "Bağlantıyı Kes")
                {
                    if (exec.Connected == true)
                    {
                        exec.Close();
                        button1.Text = "Bağlan";
                    }
                }
                
            }
        }
  • 24-01-2014, 15:05:08
    #3
    Üyeliği durduruldu
    çok tşkler ilginiz için
  • 25-01-2014, 11:18:15
    #4
    Üyeliği durduruldu
    anx adlı üyeden alıntı: mesajı görüntüle
    Merhaba,

    Nerede hata yaptınız tam olarak bilemiyorum ama bağlantı kodunu belirttiğiniz şekilde paylaşıyorum.

    Teşekkürler.

    public partial class Form1 : Form
        {
            static SshExec exec;
    
            public Form1()
            {
                InitializeComponent();
            }
    
            private void button1_Click(object sender, EventArgs e)
            {
                if (button1.Text == "Bağlan")
                {
                        try
                        {
    
                            exec = new SshExec(textBox1.Text, textBox2.Text, textBox3.Text);
                            exec.Connect(int.Parse(textBox4.Text));
    
                            if (exec.Connected == true)
                            {
                                MessageBox.Show("Bağlantı kuruldu");
                                button1.Text = "Bağlantıyı Kes";
                            }
    
                        }
    
                        catch (Exception ex)
                        {
                            MessageBox.Show(ex.Message);
                        }
                 }
    
                else if (button1.Text == "Bağlantıyı Kes")
                {
                    if (exec.Connected == true)
                    {
                        exec.Close();
                        button1.Text = "Bağlan";
                    }
                }
                
            }
        }

    çok tşkler ilgin için