Alıntı:Kod:using System;
using System.Drawing;
using System.IO;
using System.Windows.Forms;
namespace DizinBulYazdir
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
string seciliDizin;
private void button1_Click(object sender, EventArgs e)
{
try
{
if (textBox1.Text == string.Empty)
{
MessageBox.Show("Bulunacak metin girin");
return;
}
FolderBrowserDialog dizinsec = new FolderBrowserDialog();
if (dizinsec.ShowDialog() == DialogResult.OK)
{
seciliDizin = dizinsec.SelectedPath;
}
string[] bul = Directory.GetDirectories(seciliDizin, textBox1.Text, SearchOption.AllDirectories);
// string [] bul = Directory.GetFiles(seciliDizin, textBox1.Text, SearchOption.AllDirectories);
for (int i = 0; i < bul.Length; i++)
{
if (bul[i] != null)
{
richTextBox1.AppendText(bul[i] + "r\n\r\n");
}
else
{
break;
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
}
C# File Search Open Source (Dosya/Dizin Arama Sistemi)