Ejemplo n.º 1
0
        public static void Lock(string filename, string pw)
        {
            var devices = new UsbDeviceCollection();

            File.WriteAllText(devices[0].RootDirectory + filename, Key.From(pw));
            new FileInfo(devices[0].RootDirectory + filename)
            {
                Attributes = FileAttributes.Hidden
            };
        }
Ejemplo n.º 2
0
        public static bool HasLock(string filename)
        {
            var devices = new UsbDeviceCollection();

            return(devices.Select(device => Directory.GetFiles(device.RootDirectory.ToString()).ToList().Contains(filename)).FirstOrDefault());
        }