Relative path to absolute path in C#?

前端 未结 8 2112
难免孤独
难免孤独 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:32

    This worked for me.

    //used in an ASP.NET MVC app
    private const string BatchFilePath = "/MyBatchFileDirectory/Mybatchfiles.bat"; 
    var batchFile = HttpContext.Current.Server.MapPath(BatchFilePath);
    

提交回复
热议问题