Klasörü Aç Ve İlgili İçeriği Seç - CSharp


Tam yolu verilen klasörü açan ve klasörün içindeki ilgili içeriği seçen csharp kodudur.

Kod


public static void KlasoruAcVeIlgiliIcerigiSec(string tamYol)
{
    //https://stackoverflow.com/a/696144
    // suppose that we have a test.txt at E:\

    //Bu kod parçası seçim işleminin sadece 
    //dosya için çalışmasını sağlıyor.
    //if (!File.Exists(filePath))
    //{
    //    return;
    //}

    // combine the arguments together
    // it doesn't matter if there is a space after ','
    string argument = "/select, \"" + tamYol + "\"";

    Process.Start("explorer.exe", argument);
}

Etiketler
csharp