Search code examples
fileuriunc

UNC path to File URI


how to convert UNC path to File URI.. For my application user will give css UNC path like this in test box :

\\egng4573\D$\CSS\Style.css

how can i change it to :

file:///D:/CSS/Style.css

so that firefox and IE both can access css from the desired path and apply on them.. please tell....


Solution

  • In .NET,

    let unc = @"\\egng4573\D$\CSS\Style.css"
    

    then

    new System.Uri(unc)
    

    should do it.

    val it : System.Uri = file://egng4573/D$/CSS/Style.css