Ejemplo n.º 1
0
        public static string LastSelectedFile()
        {
            string        recent = Environment.GetFolderPath(Environment.SpecialFolder.Recent);
            DirectoryInfo info   = new DirectoryInfo(recent);

            FileInfo[] files = info.GetFiles().OrderBy(p => p.LastAccessTime).ToArray();

            if (files.Length > 0)
            {
                for (int i = 1; i <= files.Length; i++)
                {
                    LNK link = new LNK(files[files.Length - i].FullName);
                    if (!link.FileAttribute.archive)
                    {
                        continue;
                    }

                    return(link.Path);
                }
            }

            return(null);
        }
Ejemplo n.º 2
0
        public static string LastSelectedFile()
        {
            string recent = Environment.GetFolderPath(Environment.SpecialFolder.Recent);
            DirectoryInfo info = new DirectoryInfo(recent);
            FileInfo[] files = info.GetFiles().OrderBy(p => p.LastAccessTime).ToArray();

            if (files.Length > 0)
            {
                for (int i = 1; i <= files.Length ; i++)
                {
                    LNK link = new LNK(files[files.Length - i].FullName);
                    if (!link.FileAttribute.archive)
                        continue;

                    return link.Path;
                }
            }

            return null;
        }