Advertisement
Guest User

ktokt

a guest
Aug 14th, 2015
360
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.92 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace SSH_All_In_One
  12. {
  13.     public partial class Form1 : Form
  14.     {
  15.         public Form1()
  16.         {
  17.             InitializeComponent();
  18.         }
  19.  
  20.         private void Form1_Load(object sender, EventArgs e)
  21.         {
  22.  
  23.         }
  24.  
  25.         private void btnThuchien_Click(object sender, EventArgs e)
  26.         {
  27.             if (cbTacvu.SelectedIndex == 0)
  28.             {
  29.                 loc_ssh_hu();
  30.             }
  31.             else
  32.             {
  33.                 MessageBox.Show("tac vu dang duoc cap nhat");
  34.             }
  35.         }
  36.         public void loc_ssh_hu()
  37.         {
  38.             string[] danh_sach_nhap_vao = txtDauVao.Text.Trim().Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
  39.             for (int i = 0; i < danh_sach_nhap_vao.Length; i++)
  40.             {
  41.                 string ssh = danh_sach_nhap_vao[i];
  42.                 //Kiem tra khong rong
  43.                 if (string.IsNullOrEmpty(ssh) == false)
  44.                 {
  45.                     //kiem tra ssh hop le
  46.                     string[] ssh_Array = ssh.Split('|');
  47.                     if (ssh_Array.Length >= 3)
  48.                     {
  49.                         txtDauRa.Text += ssh + Environment.NewLine;
  50.                     }
  51.                 }
  52.                 //MessageBox.Show(danh_sach_nhap_vao[i]);
  53.             }
  54.         }
  55.  
  56.  
  57.         private void cbTacvu_SelectedIndexChanged(object sender, EventArgs e)
  58.         {
  59.             //if (cbTacvu.SelectedIndex == 0)
  60.             //{
  61.             //    MessageBox.Show("loc ssh hu");
  62.             //}
  63.             //else if (cbTacvu.SelectedIndex == 1)
  64.             //{
  65.             //    MessageBox.Show("loc ssh trung user pass");
  66.             //}
  67.         }
  68.     }
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement