コード例 #1
0
        protected override void OnStart(string[] args)
        {
            if (_vfsManager == null)
            {
                var hybridFileSystem = new FileSystemProviderStack(
                    new WebServiceFileSystemProvider(new Uri(ConfigurationManager.AppSettings["httpclienturi"])),
                    new FileSystemProviderStack(
                        new DirectoryProxyFileSystemProvider(ConfigurationManager.AppSettings["dirtoproxy"]),
                        null));

                try
                {
                    _vfsManager = new VFSManager(ConfigurationManager.AppSettings["mountpoint"], hybridFileSystem);
                }
                catch (Exception e)
                {
                    log.Error(e);
                    _vfsManager = null;
                }
            }
        }
コード例 #2
0
        private static void Main()
        {
            // to stack file systems, the next item is another FileSystemProviderStack
            var hybridFileSystem = new FileSystemProviderStack(
                new WebServiceFileSystemProvider(new Uri(ConfigurationManager.AppSettings["httpclienturi"])),
                new FileSystemProviderStack(
                    new DirectoryProxyFileSystemProvider(ConfigurationManager.AppSettings["dirtoproxy"]),
                    null));

            try
            {
                using (var vfsManager = new VFSManager(ConfigurationManager.AppSettings["mountpoint"], hybridFileSystem))
                {
                    Console.WriteLine("Mounted, press any key to unmount and exit...");
                    Console.ReadKey(false);
                }
            }
            catch (Exception e)
            {
                log.Error(e);
            }
        }