With very little C# code you are able to loop through all the files at a given path.
1. using System;
2. using System.Collections.Generic;
3. using System.ComponentModel;
4. using System.Data;
5. using System.Drawing;
6. using System.Text;
7. using System.Windows.Forms;
8. // Necessary for the Directory class
9. using System.IO;
10.
11. namespace PictureQuality
12. {
13. public partial class Form1 : Form
14. {
15. public Form1()
16. {
17. InitializeComponent();
18. }
19.
20. // btnOpen is a simple Button
21. private void btnOpen_Click(object sender, EventArgs e)
22. {
23. // fbdOpen is a FolderBrowserDialog
24. if (fbdOpen.ShowDialog() == DialogResult.OK)
25. {
26. // Loop through the files in the directory at the selected path
27. foreach(string File in Directory.GetFiles(fbdOpen.SelectedPath))
28. {
29. // Show the complete file path (including file name)
30. MessageBox.Show(File);
31. }
32. }
33. }
34. }
35. }
Nathan Pakovskie is an esteemed senior developer and educator in the tech community, best known for his contributions to Geekpedia.com. With a passion for coding and a knack for simplifying complex tech concepts, Nathan has authored several popular tutorials on C# programming, ranging from basic operations to advanced coding techniques. His articles, often characterized by clarity and precision, serve as invaluable resources for both novice and experienced programmers. Beyond his technical expertise, Nathan is an advocate for continuous learning and enjoys exploring emerging technologies in AI and software development. When he’s not coding or writing, Nathan engages in mentoring upcoming developers, emphasizing the importance of both technical skills and creative problem-solving in the ever-evolving world of technology.
Specialties: C# Programming, Technical Writing, Software Development, AI Technologies, Educational Outreach