本文整理汇总了C#中System.IO.FileSystem.CreateDirectory方法的典型用法代码示例。如果您正苦于以下问题:C# FileSystem.CreateDirectory方法的具体用法?C# FileSystem.CreateDirectory怎么用?C# FileSystem.CreateDirectory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.IO.FileSystem
的用法示例。
在下文中一共展示了FileSystem.CreateDirectory方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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
示例2: 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
示例3: SetUp
public void SetUp()
{
theCodeDir = ".".AppendPath("code");
theSolutionDir = theCodeDir.AppendPath("ripple");
theCurrentDir = theSolutionDir.AppendPath("src", "project1");
var fileSystem = new FileSystem();
fileSystem.CreateDirectory(theCodeDir);
fileSystem.CreateDirectory(theSolutionDir);
fileSystem.CreateDirectory(theCurrentDir);
fileSystem.WriteStringToFile(Path.Combine(theSolutionDir, SolutionFiles.ConfigFile), "");
RippleFileSystem.StubCurrentDirectory(theCurrentDir);
}
示例4: ExportTo
public void ExportTo(string directory, Topic root, Func<Topic, string> pathing)
{
var fileSystem = new FileSystem();
string sourceContent = _settings.Root.AppendPath("content");
if (fileSystem.DirectoryExists(sourceContent))
{
fileSystem.CopyToDirectory(sourceContent, directory.AppendPath("content"));
}
root.AllTopicsInOrder().Each(topic =>
{
var path = pathing(topic);
var parentDirectory = path.ParentUrl();
if (parentDirectory.IsNotEmpty())
{
fileSystem.CreateDirectory(directory.AppendPath(parentDirectory));
}
var text = _generator.Generate(topic);
// Hoakum
topic.Substitutions.Each((key, value) =>
{
text = text.Replace(key, value);
});
fileSystem.WriteStringToFile(directory.AppendPath(path), text);
});
}
示例5: 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"));
}
示例6: 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"));
}
示例7: 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());
}
示例8: SetUp
public void SetUp()
{
theFileSystem = new FileSystem();
theSolutionDir = Guid.NewGuid().ToString().ToFullPath();
theFileSystem.CreateDirectory(theSolutionDir);
theFileSystem.CreateDirectory(theSolutionDir, "src");
theFileSystem.WriteStringToFile(Path.Combine(theSolutionDir, "src", "Solution.sln"), "");
createProject("ProjectA");
createProject("ProjectB");
createProject("ProjectC");
RippleFileSystem.StopTraversingAt(theSolutionDir.ParentDirectory());
RippleFileSystem.StubCurrentDirectory(theSolutionDir);
new InitCommand().Execute(new InitInput { Name = "Test" });
}
示例9: plan_for_directory
public void plan_for_directory()
{
var fileSystem = new FileSystem();
fileSystem.CreateDirectory("deep-root");
fileSystem.CleanDirectory("deep-root");
fileSystem.CreateDirectory("deep-root", "foo", "bar");
fileSystem.CreateDirectory("deep-root", "src");
fileSystem.CreateDirectory("deep-root", "packaging", "nuget");
var directories = SolutionDirectory.PlanForDirectory("deep-root");
directories.OrderBy(x => x.RelativePath).ShouldHaveTheSameElementsAs(
new SolutionDirectory("foo"),
new SolutionDirectory("foo/bar"),
new SolutionDirectory("packaging"),
new SolutionDirectory("packaging/nuget"),
new SolutionDirectory("src")
);
}
示例10: find_file_with_rakefile
public void find_file_with_rakefile()
{
var fileSystem = new FileSystem();
fileSystem.DeleteDirectory("oak");
fileSystem.CreateDirectory("oak");
fileSystem.WriteStringToFile("oak".AppendPath("rakefile"), "something");
RakeFileTransform.FindFile("oak").ToLower()
.ShouldEqual("oak".AppendPath("rakefile").ToFullPath().ToLower());
}
示例11: Create
public static FileScenario Create(Action<FileScenarioDefinition> configure)
{
var directory = Path.GetTempPath().AppendRandomPath();
var fileSystem = new FileSystem();
fileSystem.CreateDirectory(directory);
var definition = new FileScenarioDefinition(directory);
configure(definition);
return new FileScenario(directory, fileSystem);
}
示例12: SaveResult
public static void SaveResult(TestResult result, Test test, string folder)
{
result.Locator = test.GetPath().Locator;
var fileSystem = new FileSystem();
fileSystem.CreateDirectory(folder);
var filename = Path.Combine(folder, FileNameFor(test));
fileSystem.PersistToFile(result, filename);
}
示例13: 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");
}
示例14: SetUp
public void SetUp()
{
theDirectory = ".".AppendPath("local-feed").ToFullPath();
theFileSystem = new FileSystem();
theFileSystem.CreateDirectory(theDirectory);
createNuget("FubuCore", "0.9.9.9");
createNuget("FubuCore", "1.0.0.0");
createNuget("Bottles", "1.0.0.0");
createNuget("FubuNew", "1.0.0.0");
createNuget("FubuNew", "1.0.0.1-alpha");
theFeed = new FileSystemNugetFeed(theDirectory, NugetStability.ReleasedOnly);
}
示例15: SetUp
public void SetUp()
{
theDirectory = ".".AppendPath("local-feed").ToFullPath();
theFileSystem = new FileSystem();
theFileSystem.CreateDirectory(theDirectory);
createNuget("FubuCore", "0.9.9.9");
createNuget("fubuCore", "0.9.9.82819");
createNuget("FubuCore", "1.0.0.0");
createNuget("Bottles", "1.0.0.0");
createNuget("ExtendHealth.Quoting.Imm.Data", "2.2.0.275");
createNuget("ExtendHealth.Quoting.Imm.Data", "2.2.0.249");
createNuget("FubuNew", "1.0.0.0");
createNuget("FubuNew", "1.0.0.1-alpha");
theFeed = new FloatingFileSystemNugetFeed(theDirectory, NugetStability.Anything);
}