Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.02 KB | None | 0 0
  1. string Pfad = string.Empty;
  2.  
  3.             OpenFileDialog openFileDialog1 = new OpenFileDialog();
  4.             openFileDialog1.Filter = "txt files (*.txt)|*.txt|All files(*.*)|*.*";
  5.             if (openFileDialog1.ShowDialog() == DialogResult.OK)
  6.             {
  7.                 Pfad = openFileDialog1.FileName;
  8.  
  9.                 pfadMain = Pfad;
  10.  
  11.                 // Datei open
  12.                 string zeile = File.ReadAllText(Pfad);
  13.                 String[] zeilen = zeile.Split('\n');
  14.  
  15.                 foreach (String c in zeilen)
  16.                 {
  17.                     String line = c.Trim();
  18.                     spalten = line.Split(',');
  19.  
  20.                     if (spalten.Length < 3)
  21.                     {
  22.                         continue;
  23.                     }
  24.  
  25.                     PasswordEintrag pe = new PasswordEintrag(this);
  26.                     pe.SetName(spalten[0]);
  27.                     pe.SetLogin(spalten[1]);
  28.                     pe.SetPasswort(spalten[2]);
  29.  
  30.                     flowLayout.Controls.Add(pe);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement