Relative path to absolute path in C#?

前端 未结 8 2128
难免孤独
难免孤独 2020-12-02 14:14

I have xml files that contain href file paths to images (e.g. \"....\\images\\image.jpg\"). The hrefs contain relative paths. Now, I need to extract the hrefs to the images

8条回答
  •  感情败类
    2020-12-02 14:45

    This worked.

    var s = Path.Combine(@"C:\some\location", @"..\other\file.txt");
    s = Path.GetFullPath(s);
    

提交回复
热议问题