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


C# Path.ToString方法代码示例

本文整理汇总了C#中Path.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Path.ToString方法的具体用法?C# Path.ToString怎么用?C# Path.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Path的用法示例。


在下文中一共展示了Path.ToString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: EnsureDirectory

 public static void EnsureDirectory(this IFileSystem fileSystem, Path directory)
 {
     var path = directory.ToString();
     if(fileSystem.DirectoryExists(path))
         return;
     fileSystem.CreateDirectory(path);
 }
开发者ID:danaxa,项目名称:Pencil,代码行数:7,代码来源:FileSystemExtensions.cs

示例2: AddADSIPath

 public static string AddADSIPath( string Path, Path ADSIPath )
 {
     if( Path.IndexOf( "://" ) != - 1 )
     {
         //Clean existing ADs path first
         Path = Path.Substring( Path.Length - Path.Length - ( Path.IndexOf( "://" ) + 3 ), Path.Length - ( Path.IndexOf( "://" ) + 3 ) );
     }
     return ADSIPath.ToString() + "://" + Path;
 }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:9,代码来源:Utilities.cs

示例3: MakeRequestAsync

        public static async Task<Dictionary<int, Dictionary<string, ClassLine>>> MakeRequestAsync(Path path)
        {
                // Create a HTTP Client:
                var client = new HttpClient();

                // Make a request:
                var response = await client.GetAsync(path.ToString());

                // Get data:
                return await response.Content.ReadAsAsync<Dictionary<int, Dictionary<string, ClassLine>>>();
        }
开发者ID:msandim,项目名称:dashboard360-sinf,代码行数:11,代码来源:MetricsManager.cs

示例4: Save

        public static void Save(Path path, string fileName)
        {
            if (string.IsNullOrEmpty(fileName))
            {
                throw new ArgumentException("The name of the file cannot be empty.");
            }

            using (var file = new StreamWriter(fileName))
            {
                file.Write(path.ToString());
            }
        }
开发者ID:atanas-georgiev,项目名称:TelerikAcademy-1,代码行数:12,代码来源:PathStorage.cs

示例5: Main

 static void Main()
 {
     Point3D p = new Point3D();
         Point3D q = new Point3D(4, 4, 4);
         Console.WriteLine(CalcDistance.Distance(p, q));
         Path path = new Path();
         path.Add(p);
         path.Add(q);
         path.Add(new Point3D(9, 9, 9));
         Console.WriteLine(path.ToString());
         PathStorage.Save(path);
         Console.WriteLine(PathStorage.Load().ToString());
 }
开发者ID:nikolaZ,项目名称:TelerikAcademy,代码行数:13,代码来源:Program.cs

示例6: Main

 static void Main()
 {
     Path path = new Path();
     path.AddPoint(new Point(1, 2, 3));
     path.AddPoint(Point.CoordStart);
     path.AddPoint(new Point(4, 5, 6));
     path.AddPoint(new Point(7, 8, 9));
     path.AddPoint(new Point(11, 12, 13));
     Console.WriteLine(path.ToString());
     string filePath = @"..\..\save.txt";
     PathStorage.SavePath(filePath, path);
     Path pathLoad = PathStorage.LoadPath(filePath);
     Console.WriteLine(pathLoad.ToString());
 }
开发者ID:NasC0,项目名称:Telerik_Homework,代码行数:14,代码来源:PathTest.cs

示例7: Main

    private static void Main()
    {
        var coordinate = new Point(2, 8, 4);

        Console.WriteLine(coordinate);
        Console.WriteLine(Point.Start);
        Console.WriteLine(Distance.CalculateDistance(coordinate, Point.Start));

        Path path = new Path(new Point(3, 1, 8), new Point(15, 5.2, 6), new Point(8, 6.3, 4));
        Console.WriteLine(path.ToString());

        PathStorage.Save(path, "../../save.txt");

        Path path2 = new Path();
        path2 = PathStorage.Load("../../load.txt");
        PathStorage.Save(path2, "../../save.txt");
    }
开发者ID:RuParusheva,项目名称:TelerikAcademy,代码行数:17,代码来源:Test.cs

示例8: SavePath

 public static void SavePath(Path path, string file)
 {
     File.WriteAllText(file, path.ToString());
 }
开发者ID:dlvasilev,项目名称:Telerik-School-Academy,代码行数:4,代码来源:PathStorage.cs

示例9: Write

 public static void Write(Path path, string file = DefaultFile)
 {
     File.WriteAllText(file, path.ToString());
 }
开发者ID:vstaykov,项目名称:TelerikAcademy,代码行数:4,代码来源:PathStorage.cs

示例10: Test_EmptySegments

		public void Test_EmptySegments()
		{
			var p = new Path("a//b");
			Assert.AreEqual(2, p.Segments.Count);
			Assert.AreEqual("a", p.Segments[0].ResourceKey);
			Assert.AreEqual("b", p.Segments[1].ResourceKey);
			Assert.AreEqual("a/b", p.ToString());

			p = new Path("a///b");
			Assert.AreEqual(2, p.Segments.Count);
			Assert.AreEqual("a", p.Segments[0].ResourceKey);
			Assert.AreEqual("b", p.Segments[1].ResourceKey);
			Assert.AreEqual("a/b", p.ToString());

			p = new Path("/a///b/");
			Assert.AreEqual(2, p.Segments.Count);
			Assert.AreEqual("a", p.Segments[0].ResourceKey);
			Assert.AreEqual("b", p.Segments[1].ResourceKey);
			Assert.AreEqual("a/b", p.ToString());
		}
开发者ID:m-berkani,项目名称:ClearCanvas,代码行数:20,代码来源:PathTests.cs

示例11: BuildAction

		internal IAction BuildAction()
		{
			IAction action = AbstractAction.Create(_action);

			Stack<PathSegment> stack = new Stack<PathSegment>();
			AbstractActionModelTreeNode current = this;
			do
			{
				stack.Push(current.PathSegment);
				current = current.Parent;
			} while (current != null);

			Path path = new Path(stack.Pop()); // the first path segment is the site, which is never processed through the resource resolver
			while (stack.Count > 0)
			{
				// for each subsequent segment, ensure the action's resolver will resolve the string in the expected way
				PathSegment pathSegment = stack.Pop();
				string localizedString = action.ResourceResolver.LocalizeString(pathSegment.ResourceKey);
				if (localizedString == pathSegment.LocalizedText)
					path = path.Append(pathSegment);
				else
					path = path.Append(new PathSegment(pathSegment.LocalizedText, pathSegment.LocalizedText));
			}

			action.Path = new ActionPath(path.ToString(), action.ResourceResolver);
			return action;
		}
开发者ID:nhannd,项目名称:Xian,代码行数:27,代码来源:AbstractActionModelTreeLeafAction.cs

示例12: PathException

 public PathException(Path p, String s) : this(p.ToString() + s)
 {
 }
开发者ID:Vandborg,项目名称:SW505E14-Software,代码行数:3,代码来源:PathException.cs

示例13: WithSubPath

 public Path WithSubPath(Path subPath) {
     return new FilePath(System.IO.Path.Combine(directoryPath, subPath.ToString()));
 }
开发者ID:GibSral,项目名称:fitsharp,代码行数:3,代码来源:Path.cs

示例14: FileExportItem

 public FileExportItem(Path relativePath, IFile file, IPackage package)
 {
     Path = relativePath.ToString();
     File = file;
     Package = package;
 }
开发者ID:modulexcite,项目名称:openwrap,代码行数:6,代码来源:FileExportItem.cs

示例15: GetRootForestPath

        ///<summary>
        ///    Obtain the path to access top level domain entry in Windows Active Directory
        ///</summary>
        ///<remarks>For better performance and avoid error, Global Catalog is preferer accessing method
        ///</remarks>
        ///<history>
        ///    [tamttt]	08/01/2004	Created
        ///</history>
        public static string GetRootForestPath( Path ADSIPath )
        {
            try
            {
                string strADSIPath = ADSIPath.ToString() + "://";
                DirectoryEntry ADsRoot = new DirectoryEntry( strADSIPath + "rootDSE" );
                string strRootDomain = strADSIPath + Convert.ToString( ADsRoot.Properties[Configuration.ADSI_ROOTDOMAINNAMIMGCONTEXT].Value );

                return strRootDomain;
            }
            catch( COMException ex )
            {
                Exceptions.LogException( ex );
                return null;
            }
        }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:24,代码来源:Utilities.cs


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