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
VulpesPosted Nov 19, 2014, 5:56 AM
AkshayPosted Nov 19, 2014, 6:20 AM
AkshayPosted Nov 19, 2014, 5:19 AM
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";
Joginder BangerPosted Nov 19, 2014, 5:11 AM
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);