本文整理汇总了C#中FileSystem.CreateDirectory方法的典型用法代码示例。如果您正苦于以下问题:C# FileSystem.CreateDirectory方法的具体用法?C# FileSystem.CreateDirectory怎么用?C# FileSystem.CreateDirectory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FileSystem
的用法示例。
在下文中一共展示了FileSystem.CreateDirectory方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetUp
public void SetUp()
{
var fileSystem = new FileSystem();
fileSystem.CreateDirectory("Solution1");
fileSystem.CleanDirectory("Solution1");
fileSystem.CreateDirectory(@"Solution1\docs");
fileSystem.CreateDirectory(@"Solution1\harness");
fileSystem.Copy("SlickGridHarness.csproj.fake", @"Solution1\harness\SlickGridHarness.csproj");
fileSystem.Copy("FubuMVC.SlickGrid.Docs.csproj.fake", @"Solution1\docs\FubuMVC.SlickGrid.Docs.csproj");
theSolutionProject = new SolutionProject("Project(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"FubuMVC.SlickGrid\", \"FubuMVC.SlickGrid\\FubuMVC.SlickGrid.csproj\", \"{A67A0CE1-E4C2-45FC-9019-829D434B2CC4}\"", "Solution1");
}
示例2: BeforeEach
public void BeforeEach()
{
var fs = new FileSystem();
fs.DeleteDirectory(thePathToScan);
fs.CreateDirectory(thePathToScan);
fs.CreateDirectory(thePathToScan, "bin");
theLoader = new SolutionDirectoryPackageLoader(thePathToScan.ToFullPath());
var manifest = new PackageManifest();
manifest.Name = "test-mani";
fs.PersistToFile(manifest, thePathToScan, PackageManifest.FILE);
}
示例3: will_use_bin_for_private_bin_path_if_it_exists
public void will_use_bin_for_private_bin_path_if_it_exists()
{
var fileSystem = new FileSystem();
fileSystem.DeleteDirectory("Service");
fileSystem.CreateDirectory("Service");
fileSystem.CreateDirectory("Service", "bin");
var expression = new RemoteDomainExpression();
expression.Setup.PrivateBinPath.ShouldBeNull();
expression.ServiceDirectory = "Service";
expression.Setup.PrivateBinPath.ShouldEqual("bin");
}
示例4: CreateChildDirectory
public IDirectory CreateChildDirectory(string name)
{
var newPath = System.IO.Path.Combine(Path, name);
var fileSystem = new FileSystem();
fileSystem.CreateDirectory(newPath);
return fileSystem.GetDirectory(newPath);
}
示例5: Main
public static int Main(string[] args)
{
var fileSystem = new FileSystem();
string srcDirectory = AppDomain.CurrentDomain.BaseDirectory.ParentDirectory().ParentDirectory().ParentDirectory().ParentDirectory();
string buildDirectory = args.Any()
? args.Single()
: srcDirectory.ParentDirectory().ParentDirectory().AppendPath("buildsupport");
Console.WriteLine("Trying to copy to " + buildDirectory);
if (!fileSystem.DirectoryExists(buildDirectory))
{
throw new ApplicationException("Could not find the buildsupport directory");
}
var targetDirectory = buildDirectory.AppendPath("FubuDocs");
fileSystem.CreateDirectory(targetDirectory);
fileSystem.CleanDirectory(targetDirectory);
var fromDirectory = srcDirectory.AppendPath("FubuDocsRunner").AppendPath("bin").AppendPath("debug");
var files = FileSet.Deep("*.dll;*.pdb;*.exe");
fileSystem.FindFiles(fromDirectory, files).Each(file => {
Console.WriteLine("Copying {0} to {1}", file, targetDirectory);
fileSystem.Copy(file, targetDirectory, CopyBehavior.overwrite);
});
return 0;
}
示例6: will_use_bin_debug_for_private_bin_path_if_it_exists_and_release_does_not
public void will_use_bin_debug_for_private_bin_path_if_it_exists_and_release_does_not()
{
var fileSystem = new FileSystem();
fileSystem.DeleteDirectory(serviceDirectory);
fileSystem.CreateDirectory(serviceDirectory);
fileSystem.CreateDirectory(serviceDirectory, "bin");
fileSystem.CreateDirectory(serviceDirectory, "bin", "Debug");
var expression = new RemoteDomainExpression();
expression.Setup.PrivateBinPath.ShouldBeNull();
expression.ServiceDirectory = serviceDirectory;
expression.Setup.PrivateBinPath.ShouldBe("bin".AppendPath("Debug"));
}
示例7: SetUp
public void SetUp()
{
theFileSystem = new FileSystem();
theSolutionDir = Guid.NewGuid().ToString().ToFullPath();
theFileSystem.CreateDirectory(theSolutionDir);
theFileSystem.CreateDirectory(theSolutionDir, "src");
createProject("ProjectA");
createProject("ProjectB");
createProject("ProjectC");
RippleFileSystem.StopTraversingAt(theSolutionDir.ParentDirectory());
RippleFileSystem.StubCurrentDirectory(theSolutionDir);
new InitCommand().Execute(new InitInput { Name = "Test" });
}
示例8: will_use_bin_release_for_private_bin_path_if_it_exists_and_release_has_precedence
public void will_use_bin_release_for_private_bin_path_if_it_exists_and_release_has_precedence()
{
var fileSystem = new FileSystem();
fileSystem.DeleteDirectory("Service");
fileSystem.CreateDirectory("Service");
fileSystem.CreateDirectory("Service", "bin");
fileSystem.CreateDirectory("Service", "bin", "Release");
fileSystem.CreateDirectory("Service", "bin", "Debug");
var expression = new RemoteDomainExpression();
expression.Setup.PrivateBinPath.ShouldBeNull();
expression.ServiceDirectory = "Service";
expression.Setup.PrivateBinPath.ShouldEqual("bin".AppendPath("Release"));
}
示例9: DownloadTo
public INugetFile DownloadTo(Solution solution, string directory)
{
var files = new FileSystem();
files.CreateDirectory(directory);
var fileName = "{0}.{1}.nupkg".ToFormat(Name, Version);
files.WriteStringToFile(fileName, "");
return new StubNugetFile(new Dependency(Name, Version.ToString())) { FileName = fileName};
}
示例10: explode_smoke_test
public void explode_smoke_test()
{
var file = new NugetFile("Bottles.1.0.0.441.nupkg", SolutionMode.Ripple);
var system = new FileSystem();
system.CreateDirectory("bottles");
system.CleanDirectory("bottles");
var package = file.ExplodeTo("bottles");
package.ShouldNotBeNull();
package.AssemblyReferences.Single().Name.ShouldEqual("Bottles.dll");
}
示例11: CreateDirectoryTest
public void CreateDirectoryTest()
{
FileSystem target = new FileSystem();
string path = "\\folder1";
string userEmail = "[email protected]";
string userPass = "pass2";
target.CreateDirectory(path, userEmail, userPass);
path = "\\folder1\\folder1_1\\folder1_1_1";
userEmail = "[email protected]";
userPass = "pass2";
target.CreateDirectory(path, userEmail, userPass);
}
示例12: 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 string[]{"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");
}
示例13: ExplodeTo
public IPackage ExplodeTo(string directory)
{
var explodedDirectory = directory.AppendPath(Name).ToFullPath();
RippleLog.Info("Exploding to " + explodedDirectory);
var fileSystem = new FileSystem();
fileSystem.CreateDirectory(explodedDirectory);
fileSystem.CleanDirectory(explodedDirectory);
fileSystem.DeleteFile(FileName);
fileSystem.WriteStringToFile(explodedDirectory.AppendPath(FileName), "");
return new StubPackage(Name, Version.ToString());
}
示例14: do_not_use_bin_for_private_bin_path_if_it_does_not_exist
public void do_not_use_bin_for_private_bin_path_if_it_does_not_exist()
{
var fileSystem = new FileSystem();
fileSystem.DeleteDirectory("Service2");
fileSystem.CreateDirectory("Service2");
var expression = new RemoteDomainExpression();
expression.Setup.PrivateBinPath.ShouldBeNull();
expression.ServiceDirectory = "Service2";
expression.Setup.PrivateBinPath.ShouldBeNull();
}
示例15: FixtureSetUp
public void FixtureSetUp()
{
theScenario = SolutionScenario.Create(scenario =>
{
scenario.Solution("FubuCore", fubucore => fubucore.Publishes("FubuCore"));
});
theNugetDirectory = theScenario.Directory.AppendPath("nugets");
theFileSystem = new FileSystem();
theFileSystem.CreateDirectory(theNugetDirectory);
theSolution = theScenario.Find("FubuCore");
theSolution.Package(new PackageParams(theSolution.Specifications.Single(), new SemanticVersion("1.1.1.1"), theNugetDirectory, _publishSymbols));
}