当前位置: 首页>>代码示例>>C#>>正文


C# FileSystem.CreateDirectory方法代码示例

本文整理汇总了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);
        }
开发者ID:ventaur,项目名称:ripple,代码行数:15,代码来源:RippleFileSystemTester.cs

示例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);
            });
        }
开发者ID:storyteller,项目名称:Storyteller,代码行数:32,代码来源:Exporter.cs

示例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"));
        }
开发者ID:jemacom,项目名称:fubumvc,代码行数:31,代码来源:PackageFilesIntegrationTester.cs

示例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"));
        }
开发者ID:jericsmith,项目名称:fubumvc,代码行数:27,代码来源:PackageFilesIntegrationTester.cs

示例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());
        }
开发者ID:awelburn,项目名称:FubuCsProjFile,代码行数:9,代码来源:RakeFileTransformTester.cs

示例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" });
        }
开发者ID:modulexcite,项目名称:ripple,代码行数:18,代码来源:IntegratedInitCommandTester.cs

示例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")
                );
        }
开发者ID:awelburn,项目名称:FubuCsProjFile,代码行数:18,代码来源:SolutionDirectoryTester.cs

示例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());
        }
开发者ID:awelburn,项目名称:FubuCsProjFile,代码行数:11,代码来源:RakeFileTransformTester.cs

示例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);
		}
开发者ID:DarthFubuMVC,项目名称:FubuMVC.AssetTransforms,代码行数:11,代码来源:FileScenario.cs

示例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);
        }
开发者ID:adymitruk,项目名称:storyteller,代码行数:11,代码来源:ResultPersistor.cs

示例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");
        }
开发者ID:DarthFubuMVC,项目名称:bottles,代码行数:24,代码来源:BottleManifestReaderTester.cs

示例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);
        }
开发者ID:ventaur,项目名称:ripple,代码行数:16,代码来源:FileSystemFeedTester.cs

示例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);
        }
开发者ID:modulexcite,项目名称:ripple,代码行数:20,代码来源:FileSystemFeedTester.cs


注:本文中的System.IO.FileSystem.CreateDirectory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。