本文整理汇总了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")
);
}
示例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"));
}
示例3: TearDown
public void TearDown()
{
var fileSystem = new FileSystem();
fileSystem.DeleteDirectory(theCodeDir);
RippleFileSystem.Live();
}
示例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"));
}
示例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());
}
示例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());
}
示例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);
}
示例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();
}
示例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");
}
示例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");
}
示例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");
}
示例14: SetUp
public void SetUp()
{
var fileSystem = new FileSystem();
fileSystem.DeleteDirectory("myfoo");
fileSystem.CreateDirectory("myfoo");
}
示例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"));
}