Maybe2013
Maybe2013

Reputation: 601

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....

Upvotes: 3

Views: 8162

Answers (1)

Pete Montgomery
Pete Montgomery

Reputation: 4100

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

Upvotes: 5

Related Questions