From bc08238545364e225214f39855b8e1799927937c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miskolczi=20Rich=C3=A1rd?= Date: Fri, 24 Mar 2023 12:40:10 +0100 Subject: [PATCH] oops forgot to add new class --- Password Manager/ResultListBox.cs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Password Manager/ResultListBox.cs diff --git a/Password Manager/ResultListBox.cs b/Password Manager/ResultListBox.cs new file mode 100644 index 0000000..0a31a23 --- /dev/null +++ b/Password Manager/ResultListBox.cs @@ -0,0 +1,23 @@ +using System; + +namespace Password_Manager +{ + public class ResultListBox : ListBox + { + public ResultListBox() : base() { } + + public void Refresh() + { + DirectoryInfo d = new DirectoryInfo(Fields.CurrentProfile.Path); //Assuming Test is your Folder + FileInfo[] files = d.GetFiles("*.gpg"); + string[] elements = new string[files.Length]; + + for (int i = 0; i < elements.Length; i++) + { + elements[i] = files[i].Name; + } + + this.DataSource = elements; + } + } +}