Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace WindowsFormsApplication5
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void label2_Click(object sender, EventArgs e)
- {
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- }
- private void BTclick_Click(object sender, EventArgs e)
- {
- if (tacvu1.Checked == true)
- {
- Loc_SSH_loi();
- }
- if (tacvu2.Checked == true)
- {
- loc_ssh_trung_toan_bo();
- }
- }
- private void cbtacvu_SelectedIndexChanged(object sender, EventArgs e)
- {
- //if (cbtacvu.SelectedIndex ==0)
- //{
- // Loc_SSH_loi();
- //}
- }
- public void Loc_SSH_loi()
- {
- string[] danh_sach_nhap_vao = txtdauvao.Text.Trim().Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
- for (int i = 0; i < danh_sach_nhap_vao.Length; i++)
- {
- string ssh = danh_sach_nhap_vao[i];
- if (string.IsNullOrEmpty(ssh) == false)
- {
- string[] ssh_nhap_vao = ssh.Split('|');
- if (ssh_nhap_vao.Length > 3)
- {
- txtdaura.Text += ssh + Environment.NewLine;
- }
- }
- }
- }
- public void loc_ssh_trung_toan_bo()
- {
- List<string> list_ssh = new List<string>();
- string[] danh_sach_nhap_vao = txtdauvao.Text.Trim().Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
- for (int i=0; i< danh_sach_nhap_vao.Length; i++)
- {
- string ssh = danh_sach_nhap_vao[i];
- if (list_ssh.Contains(ssh) == false)
- {
- list_ssh.Add(ssh);
- }
- }
- txtdaura.Text = string.Join(Environment.NewLine, list_ssh);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement