Let's say you have a directory c:\science with some .txt files in it.
You can put a DataGridView on your form and fill it like this:
using System;
using System.IO;
using System.Linq;
using System.Windows.Forms;
namespace DW_404491_CS_FORM
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
dataGridView1.DataSource =
(
from dir in Directory.GetFiles("c:/science/", "*.txt")
select new
{
FileName = Path.GetFileName(dir.ToString())
}
).ToList();
}
}
}
thines01
Postaholic
2,433 posts since Oct 2009
Reputation Points: 447
Solved Threads: 408
Skill Endorsements: 7
I did not test it with .lnk files.
All I can say is put some links in the target directory and test it.
thines01
Postaholic
2,433 posts since Oct 2009
Reputation Points: 447
Solved Threads: 408
Skill Endorsements: 7
Question Answered as of 1 Year Ago by
thines01