當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。