cementboot Posted October 28, 2006 Posted October 28, 2006 Is there any easy way to convert a string that contains a file URL ("file:///C:/") to file Path ("C:\") in VB .Net? Quote
Cags Posted October 28, 2006 Posted October 28, 2006 If the string will always start exactly like that you can simply crop the file:/// part off the start of the file using something like the SubString method. I believe .Net can function on path names that contain / the same as if it is a \ but if not you can use the strings Replace function to change them all over. Quote Anybody looking for a graduate programmer (Midlands, England)?
Killian35 Posted October 28, 2006 Posted October 28, 2006 You could use the Uri class: Dim u As New Uri("file:///C:/") Debug.WriteLine(u.LocalPath) Quote
cementboot Posted October 28, 2006 Author Posted October 28, 2006 Thanks Killian35, that worked great! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.