Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            bool retVal;


            retVal = SeBackupPrivilegeUtils.isSeBackupPrivilegeEnabled();
            Console.WriteLine(retVal ? "Yes!" : "no");
            SeBackupPrivilegeUtils.setSeBackupPrivilege(true);
            retVal = SeBackupPrivilegeUtils.isSeBackupPrivilegeEnabled();
            Console.WriteLine(retVal ? "Yes!" : "no");
            if (!retVal)
            {
                Console.WriteLine("SeBackupPrivilege is not enabled, giving up");
                return;
            }
            uint bytesCopied = 0;

            retVal = SeBackupPrivilegeUtils.CopyFile("c:/temp/x.txt", "c:/temp/y.txt", ref bytesCopied, true);
            if (retVal)
            {
                Console.WriteLine("Copied " + bytesCopied.ToString() + " bytes");
            }
        }
Exemplo n.º 2
0
        protected override void EndProcessing()
        {
            bool retVal = SeBackupPrivilegeUtils.isSeBackupPrivilegeEnabled();

            Console.WriteLine("SeBackupPrivilege is " + (retVal ? "enabled" : "disabled"));
        }