string physicalPath = @"D:\New folder\documents to be uploaded\79730\79731\96552";
I have Physical path like above :=> inside 96552 folder there is pdf file so now o want to retrieve file name and save that file name folder path in text file
in console app

VulpesRank #55 · 29.2K reputationPosted Nov 19, 2014, 12:56 AM EST
Joginder BangerRank #360 · 7K reputationPosted Nov 19, 2014, 12:11 AM EST
string fileName = @"C:\mydir\myfile.ext";
string path = @"C:\mydir\";
string result; result = Path.GetFileName(fileName);
Console.WriteLine("GetFileName('{0}') returns '{1}'", fileName, result);
result = Path.GetFileName(path); Console.WriteLine("GetFileName('{0}') returns '{1}'", path, result);
Akshay82 reputationPosted Nov 19, 2014, 12:19 AM EST
2 find file in that folder then retrieve file name
like this:=>
string fileName = @"C:\mydir"
i am don't want 2 provide path like=>
string fileName = @"C:\mydir\myfile.ext";
Akshay82 reputationPosted Nov 19, 2014, 1:20 AM EST