// GET api/values
        public FilesAccessSensor Get()
        {
            var sensor = new FilesAccessSensor();

            sensor.Update();
            return(sensor);
        }
示例#2
0
        static void Main(string[] args)
        {
            var sensor = new FilesAccessSensor {
                path = @"C:\Program Files"
            };

            sensor.Update();
            Console.WriteLine("c: " + sensor.cancreate);
            Console.WriteLine("r: " + sensor.canread);
            Console.WriteLine("e: " + sensor.canexecute);
            Console.WriteLine("d: " + sensor.candelete);
            Console.WriteLine("m: " + sensor.canmodify);
            //Run();
            //Console.WriteLine("ScreenTimeout: " + sensor.ScreenTimeout);
            //Console.WriteLine("AV-Installed: " + sensor.IsAVInstalled);
            //Console.WriteLine("PassNeeded: " + sensor.PasswordProtected);
            //while (true)
            //{
            //    sensor.Update();
            //    Console.WriteLine("F App: " + sensor.AppName);
            //    Thread.Sleep(2000);
            //}
            //foreach (var s in sensor.UserFileSystemRightses)
            //{
            //    Console.WriteLine(s);
            //}
            Console.ReadKey();
        }
        public FilesAccessSensor Get(string param)
        {
            var sensor = new FilesAccessSensor();

            if (param.Split(',').Length == 1)
            {
                param += ",";
            }
            sensor.path = String.Join("\\", param.Split(','));
            sensor.Update();
            return(sensor);
        }