當前位置: 首頁>>代碼示例>>C#>>正文


C# FileSystem.DeleteDirectory方法代碼示例

本文整理匯總了C#中System.IO.FileSystem.DeleteDirectory方法的典型用法代碼示例。如果您正苦於以下問題:C# FileSystem.DeleteDirectory方法的具體用法?C# FileSystem.DeleteDirectory怎麽用?C# FileSystem.DeleteDirectory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.IO.FileSystem的用法示例。


在下文中一共展示了FileSystem.DeleteDirectory方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: copy_directory

        public void copy_directory()
        {
            var system = new FileSystem();

            system.ResetDirectory("dagobah");
            system.WriteStringToFile("dagobah".AppendPath("f1", "a.txt"), "something");
            system.WriteStringToFile("dagobah".AppendPath("f2", "a.txt"), "something");
            system.WriteStringToFile("dagobah".AppendPath("f3", "a.txt"), "something");
            system.WriteStringToFile("dagobah".AppendPath("f1", "f1a", "a.txt"), "something");
            system.WriteStringToFile("dagobah".AppendPath("f1", "f1a", "f1b", "a.txt"), "something");
            system.WriteStringToFile("dagobah".AppendPath("a.txt"), "something");

            system.DeleteDirectory("rhenvar");
            system.Copy("dagobah", "rhenvar");

            system.FindFiles("rhenvar", FileSet.Everything()).Select(x => x.PathRelativeTo("rhenvar")).OrderBy(x => x)
                .ShouldHaveTheSameElementsAs(
                    "a.txt",
                    FileSystem.Combine("f1", "a.txt"),
                    FileSystem.Combine("f1", "f1a", "a.txt"),
                    FileSystem.Combine("f1", "f1a", "f1b", "a.txt"),
                    FileSystem.Combine("f2", "a.txt"),
                    FileSystem.Combine("f3", "a.txt")
                );
        }
開發者ID:bobpace,項目名稱:fubucore,代碼行數:25,代碼來源:FileSystemTester.cs

示例2: SetUp

        public void SetUp()
        {
            var system = new FileSystem();
            system.DeleteDirectory("geonosis");
            system.CreateDirectory("geonosis");

            var data1 = newData();
            var data2 = newData();
            var data3 = newData();
            var data4 = newData();
            var data5 = newData();
            var data6 = newData();
            var data7 = newData();

            saveData(data1, "a", "a1");
            saveData(data2, "a", "a2");
            saveData(data3, "b", "b3");
            saveData(data4, "b", "b4");
            saveData(data5, "c", "c5");
            saveData(data6, "c", "c6");
            saveData(data7, "c", "c7");

            var data8 = newData();
            data8["pak1"] = "pak1-value";
            PackageSettingsSource.WriteToDirectory(data8, "geonosis".AppendPath("a"));

            theCache = new PackageFilesCache();
            theCache.AddDirectory(FileSystem.Combine("geonosis", "a"));
            theCache.AddDirectory(FileSystem.Combine("geonosis", "b"));
            theCache.AddDirectory(FileSystem.Combine("geonosis", "c"));
        }
開發者ID:jemacom,項目名稱:fubumvc,代碼行數:31,代碼來源:PackageFilesIntegrationTester.cs

示例3: TearDown

        public void TearDown()
        {
            var fileSystem = new FileSystem();
            fileSystem.DeleteDirectory(theCodeDir);

            RippleFileSystem.Live();
        }
開發者ID:ventaur,項目名稱:ripple,代碼行數:7,代碼來源:RippleFileSystemTester.cs

示例4: SetUp

        public void SetUp()
        {
            var system = new FileSystem();
            system.DeleteDirectory("geonosis");
            system.CreateDirectory("geonosis");

            var data1 = newData();
            var data2 = newData();
            var data3 = newData();
            var data4 = newData();
            var data5 = newData();
            var data6 = newData();
            var data7 = newData();

            saveData(data1, "a", "a1");
            saveData(data2, "a", "a2");
            saveData(data3, "b", "b3");
            saveData(data4, "b", "b4");
            saveData(data5, "c", "c5");
            saveData(data6, "c", "c6");
            saveData(data7, "c", "c7");

            theCache = new PackageFilesCache();
            theCache.AddDirectory(FileSystem.Combine("geonosis", "a"));
            theCache.AddDirectory(FileSystem.Combine("geonosis", "b"));
            theCache.AddDirectory(FileSystem.Combine("geonosis", "c"));
        }
開發者ID:jericsmith,項目名稱:fubumvc,代碼行數:27,代碼來源:PackageFilesIntegrationTester.cs

示例5: find_file_with_no_rakefile

        public void find_file_with_no_rakefile()
        {
            var fileSystem = new FileSystem();
            fileSystem.DeleteDirectory("sd");
            fileSystem.CreateDirectory("sd");

            RakeFileTransform.FindFile("sd").ToLower()
                .ShouldEqual("sd".AppendPath("rakefile").ToFullPath().ToLower());
        }
開發者ID:awelburn,項目名稱:FubuCsProjFile,代碼行數:9,代碼來源:RakeFileTransformTester.cs

示例6: find_file_with_rakefile_rb

        public void find_file_with_rakefile_rb()
        {
            var fileSystem = new FileSystem();
            fileSystem.DeleteDirectory("kc");
            fileSystem.CreateDirectory("kc");

            fileSystem.WriteStringToFile("kc".AppendPath("rakefile.rb"), "something");

            RakeFileTransform.FindFile("kc").ToLower()
                .ShouldEqual("kc".AppendPath("rakefile.rb").ToFullPath().ToLower());
        }
開發者ID:awelburn,項目名稱:FubuCsProjFile,代碼行數:11,代碼來源:RakeFileTransformTester.cs

示例7: stay_with_the_default_if_no_other_config_file_is_found

        public void stay_with_the_default_if_no_other_config_file_is_found()
        {
            var fileSystem = new FileSystem();

            fileSystem.DeleteDirectory("Service");

            fileSystem.CreateDirectory("Service");
            fileSystem.CreateDirectory("Service", "bin");

            var expression = new RemoteDomainExpression();
            expression.ServiceDirectory = "Service";
            Path.GetFileName(expression.Setup.ConfigurationFile).ShouldEqual("BottleServiceRunner.exe.config");
        }
開發者ID:DarthFubuMVC,項目名稱:bottles,代碼行數:13,代碼來源:RemoteDomain_determination_of_the_app_config_file_Tester.cs

示例8: CleanTarget

        public void CleanTarget(string directory)
        {
            var fileSystem = new FileSystem();
        
            foreach (var child in Directory.GetDirectories(directory))
            {
                if (child.Contains(".git")) continue;
                
                fileSystem.DeleteDirectory(child);
            }

            fileSystem.FindFiles(directory, FileSet.Shallow("*.htm"))
                .Each(fileSystem.DeleteFile);
        }
開發者ID:storyteller,項目名稱:Storyteller,代碼行數:14,代碼來源:Exporter.cs

示例9: use_web_config_if_it_exists

        public void use_web_config_if_it_exists()
        {
            var fileSystem = new FileSystem();

            fileSystem.DeleteDirectory("Service");

            fileSystem.CreateDirectory("Service");
            fileSystem.CreateDirectory("Service", "bin");
            fileSystem.WriteStringToFile("Service".AppendPath("Web.config"), "foo");

            var expression = new RemoteDomainExpression();
            expression.ServiceDirectory = "Service";
            Path.GetFileName(expression.Setup.ConfigurationFile).ShouldEqual("web.config");
        }
開發者ID:DarthFubuMVC,項目名稱:bottles,代碼行數:14,代碼來源:RemoteDomain_determination_of_the_app_config_file_Tester.cs

示例10: create_test_zip_to_a_nonexistent_path

        public void create_test_zip_to_a_nonexistent_path()
        {
            var fileSystem = new FileSystem();
            fileSystem.DeleteDirectory(".\\nonexist");

            fileSystem.FileExists(".\\nonexist\\silly.zip").ShouldBeFalse();

            fileSystem.WriteStringToFile(".\\bob.txt","hi");
            var service = new ZipFileService(fileSystem);
            service.CreateZipFile(".\\nonexist\\silly.zip", f=>
            {
                f.AddFile(".\\bob.txt","");
            });

            fileSystem.FileExists(".\\nonexist\\silly.zip").ShouldBeTrue();
        }
開發者ID:cprieto,項目名稱:fubumvc,代碼行數:16,代碼來源:ZipFileServiceTester.cs

示例11: SetUp

        public void SetUp()
        {
            var system = new FileSystem();
            system.DeleteDirectory("package1");

            system.CreateDirectory("package1");
            system.CreateDirectory("package1", "bin");
            system.CreateDirectory("package1", "WebContent");
            system.CreateDirectory("package1", "Data");

            theOriginalManifest = new PackageManifest
            {
                Assemblies = new[] { "a", "b", "c" },
                Name = "Extraordinary"
            };

            theOriginalManifest.AddDependency("bottle1", true);
            theOriginalManifest.AddDependency("bottle2", true);
            theOriginalManifest.AddDependency("bottle3", false);

            theOriginalManifest.WriteTo("package1");

            thePackage = new PackageManifestReader(new FileSystem(), directory => directory.AppendPath("WebContent")).LoadFromFolder("package1");
        }
開發者ID:DarthFubuMVC,項目名稱:bottles,代碼行數:24,代碼來源:BottleManifestReaderTester.cs

示例12: SetUp

        public void SetUp()
        {
            fileSystem = new FileSystem();

            fileSystem.Copy("FubuMVC.SlickGrid.Docs.csproj.fake", "FubuMVC.SlickGrid.Docs.csproj");
            fileSystem.Copy("SlickGridHarness.csproj.fake", "SlickGridHarness.csproj");
            fileSystem.Copy("SlickGridHarness.csproj.fake", "SlickGridHarness/SlickGridHarness.csproj");

            fileSystem.DeleteDirectory("myproj");
            fileSystem.CreateDirectory("myproj");
        }
開發者ID:radiy,項目名稱:FubuCsProjFile,代碼行數:11,代碼來源:CsProjFileTester.cs

示例13: SetUp

        public void SetUp()
        {
            var system = new FileSystem();
            system.DeleteDirectory("localization1");
            system.DeleteDirectory("localization2");
            system.DeleteDirectory("localization3");

            system.CreateDirectory("localization1");
            system.CreateDirectory("localization2");
            system.CreateDirectory("localization3");
        }
開發者ID:henninga,項目名稱:fubulocalization,代碼行數:11,代碼來源:XmlDirectoryLocalizationStorageTester.cs

示例14: SetUp

 public void SetUp()
 {
     var fileSystem = new FileSystem();
     fileSystem.DeleteDirectory("myfoo");
     fileSystem.CreateDirectory("myfoo");
 }
開發者ID:nosami,項目名稱:FubuCsProjFile,代碼行數:6,代碼來源:MSBuildProjectTester.cs

示例15: SetUp

        public void SetUp()
        {
            var fileSystem = new FileSystem();
            fileSystem.DeleteDirectory("hoth");
            fileSystem.CreateDirectory("hoth");

            new InitializeCommand().Execute(new InitializeInput()
            {
                DeploymentFlag = "hoth".AppendPath("deployment"),
                ForceFlag = true
            });

            fileSystem.DeleteDirectory("tatooine");
            fileSystem.CreateDirectory("tatooine");
            new InitializeCommand().Execute(new InitializeInput()
            {
                DeploymentFlag = "tatooine".AppendPath("deployment"),
                ForceFlag = true
            });

            theSettings = new DeploymentSettings("hoth".AppendPath("deployment"));
            theSettings.AddImportedFolder("tatooine".AppendPath("deployment"));
        }
開發者ID:rsanders1,項目名稱:bottles,代碼行數:23,代碼來源:DeploymentSettingsTester.cs


注:本文中的System.IO.FileSystem.DeleteDirectory方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。