Is there a way to easily parse file paths in portable class libraries?

可紊 提交于 2019-12-01 16:03:18

You may be able to use or adapt the code for System.IO.Path from Mono: https://github.com/mono/mono/blob/master/mcs/class/corlib/System.IO/Path.cs

EDIT: Also, my PCL Storage library provides some file IO APIs to PCLs, including PortablePath.Combine().

I would use Uri class

var segments = new Uri("file://c:/dir1/dir2/a.txt").Segments

which is supported by PCL

http://msdn.microsoft.com/en-us/library/system.uri.aspx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!