I want to change the conversion from List<string> to the StringCollection type. To make files move faster.try{    List<string> Picture = new List<string>();    List<string> PaThS = new List<string>();    string[] SVF =  {                  Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),                    Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)                    };    foreach (var paths in SVF)                PaThS.AddRange(Directory.GetDirectories(paths));    foreach (var e in PaThS)                Picture.AddRange(Directory.GetFiles(e, *.jpg, SearchOption.AllDirectories));}catch{}}Actually by subject. Modify the StringCollection
Speed up file search
c#
Hard disk accesses are measured in ms. RAM accesses in ns, i.e. they are roughly one million times faster! This means that List<string> manipulations (which happen in RAM) are much much faster than calls to Directory.GetDirectories or Directory.GetFiles that access the storage (hard disk, usb stick, SSD ...). Replacing List<string> by StringCollection won't make any difference!List<string> and StringCollection both store data in the main memory. They don't move files and they don't search files.It makes no sense to first add data to an array just to copy it to a list afterwards. Add it to the list directly with a collection initializer:var paths = new List<string> {    Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),    Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)};What kind of crazy casing is PaThS? The usual C# style for variables is camelCase, i.e. the first character is lower case, succeeding words start with an upper-case letter.