Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

How to read recently accessed files(docx,pdf,txt,etc.)

$
0
0

I WANT TO ACCESS THE DIFFERENT FILE FORMATS IN DATAGRIDVIEW THAT ARE RECENTLY BEING USED

I ALSO TRIED THE BELOW CODE TO GET FILES FROM RECENT FOLDER BUT DOES NOT HELP WHAT TO DO:

 string[] files = Directory.GetFiles(@"C:/Users/" + userName + "/AppData/Roaming/Microsoft/Windows/Recent", "*.txt.lnk");

            string[] files2 = Directory.GetFiles(@"C:/Users/" + userName + "/AppData/Roaming/Microsoft/Windows/Recent", "*.pdf.lnk");
            string[] files3 = Directory.GetFiles(@"C:/Users/" + userName + "/AppData/Roaming/Microsoft/Windows/Recent", "*.docx.lnk");
            string[] files4 = Directory.GetFiles(@"C:/Users/" + userName + "/AppData/Roaming/Microsoft/Windows/Recent", "*.docm.lnk");
            string[] files5 = Directory.GetFiles(@"C:/Users/" + userName + "/AppData/Roaming/Microsoft/Windows/Recent", "*.doc.lnk");
            string[] files6 = Directory.GetFiles(@"C:/Users/" + userName + "/AppData/Roaming/Microsoft/Windows/Recent", "*.dotx.lnk");
           

AND MANY MORE FILE FORMATS ARE THERE BUT THE PROBLEM HERE IS THE DATAGRIDVIEW IS ALWAYS EMPTY IT DOES NOT SHOWS THE SPECIFIED FILE FORMATS FROM DIRECTORY WHAT TO DO NOW

OUTPUT THAT I SEE 


If there is any other way to read the different files which are recently being accessed please help

 

SHAH BHAUMIK A.


Viewing all articles
Browse latest Browse all 2535

Trending Articles