有没有一种方法可以轻松地解析便携式类库文件路径? [英] Is there a way to easily parse file paths in portable class libraries?

查看:111
本文介绍了有没有一种方法可以轻松地解析便携式类库文件路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要解析的路径分成部分从一个便携式类库和得到的东西,如文件名,扩展名,只是目录名等。

I'm needing to parse a path into parts from within a portable class library and get things like the filename, extension, just directory name, etc.

所有这些方法是相当容易从内System.IO.Path访问,但是,这似乎并没有内便携式类库存在。是否有一个开放源码的替代本或其他的API,它会给我相同的功能?

All of these methods are fairly easy to access from within System.IO.Path, however, this doesn't seem to exist within portable class libraries. Is there an open source replacement for this or some other API that would give me the same functionality?

推荐答案

您可能能够使用或调整$ C $下System.IO.Path从单声道:的 https://github.com/mono/mono/blob/master/mcs/class/ corlib / System.IO / Path.cs

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

编辑:另外,我的 PCL存储库提供了一些文件IO API来PCLS,包括 PortablePath.Combine()

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

这篇关于有没有一种方法可以轻松地解析便携式类库文件路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆