How to get a catalog of custom videos?

I tried this:

userVideosDirectory = Directory.GetParent(Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData)).FullName + "\\Videos"; 

But it gives me:

 C:\Users\username\AppData\Videos 

But I do not have only the AppData directory:

 C:\Users\username\Videos 

How to get a catalog of videos without AppData?

+5
source share
3 answers

You can get the video folder using the Environment.SpecialFolders.MyVideos property, and get the actual path to it using the Environment.GetFolderPath method.

 string path = Environment.GetFolderPath(Environment.SpecialFolder.MyVideos); 

Note that this enum contains many more folders that you can get.

+12
source

Have you tried this?

 string path = System.Environment.GetFolderPath(Environment.SpecialFolder.MyVideos); 
+2
source

Something like that:

 int userVideosDirectory = (Directory.GetParent(Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData)).FullName + "\\Videos").IndexOf(@"\AppData\"); if (userVideosDirectory != 0) { string str = (Directory.GetParent(Environment.GetFolderPath (Environment.SpecialFolder.ApplicationData)).FullName + "\\Videos").Remove(userVideosDirectory, @"\AppData".Length); } 
+1
source

All Articles