コード例 #1
0
 private static bool ConsoleCtrlCheck(CtrlTypes ctrlType)
 {
     if (ctrlType == CtrlTypes.CTRL_CLOSE_EVENT)
     {
         if (deleteTempDirOnClose != null)
         {
             Directory.Delete(deleteTempDirOnClose, true);
         }
         Dokan.Shutdown();
     }
     return(true);
 }
コード例 #2
0
 private static void Main()
 {
     try
     {
         var rfs = new RFS();
         Dokan.Init();
         rfs.Mount("r:\\", DokanOptions.DebugMode | DokanOptions.StderrOutput);
         Dokan.Shutdown();
         Console.WriteLine(@"Success");
     }
     catch (DokanException ex)
     {
         Console.WriteLine(@"Error: " + ex.Message);
     }
 }
コード例 #3
0
ファイル: Program.cs プロジェクト: LTRData/dokan-dotnet
        private static void Main(string[] args)
        {
            try
            {
                var arguments = args
                                .Select(x => x.Split(new char[] { '=' }, 2, StringSplitOptions.RemoveEmptyEntries))
                                .ToDictionary(x => x[0], x => x.Length > 1 ? x[1] as object : true, StringComparer.OrdinalIgnoreCase);

                var mirrorPath = arguments.ContainsKey(MirrorKey)
                   ? arguments[MirrorKey] as string
                   : @"C:\";

                var mountPath = arguments.ContainsKey(MountKey)
                   ? arguments[MountKey] as string
                   : @"N:\";

                var unsafeReadWrite = arguments.ContainsKey(UseUnsafeKey);

                Console.WriteLine($"Using unsafe methods: {unsafeReadWrite}");
                var mirror = unsafeReadWrite
                    ? new UnsafeMirror(mirrorPath)
                    : new Mirror(mirrorPath);

                Dokan.Init();

                using (DokanInstance dokanInstance = mirror.CreateFileSystem(mountPath, DokanOptions.DebugMode | DokanOptions.EnableNotificationAPI))
                {
                    var notify = new Notify();
                    notify.Start(mirrorPath, mountPath, dokanInstance);
                    dokanInstance.WaitForFileSystemClosed(uint.MaxValue);
                }

                Dokan.Shutdown();

                Console.WriteLine(@"Success");
            }
            catch (DokanException ex)
            {
                Console.WriteLine(@"Error: " + ex.Message);
            }
        }
コード例 #4
0
ファイル: Mounter.cs プロジェクト: LTRData/dokan-dotnet
 public static void AssemblyCleanup()
 {
     safeMount.Dispose();
     unsafeMount.Dispose();
     Dokan.Shutdown();
 }