「MonoやXamarinで絶対パスを取得する」を編集中
ナビゲーションに移動
検索に移動
この編集を取り消せます。 下記の差分を確認して、本当に取り消していいか検証してください。よろしければ変更を保存して取り消しを完了してください。
最新版 | 編集中の文章 | ||
10行目: | 10行目: | ||
using System; | using System; | ||
using System.IO; | using System.IO; | ||
− | |||
public static class PathUtil | public static class PathUtil | ||
19行目: | 18行目: | ||
if (path.StartsWith("~/", StringComparison.Ordinal)) | if (path.StartsWith("~/", StringComparison.Ordinal)) | ||
{ | { | ||
− | + | var homePath = Environment.GetFolderPath(Environment.SpecialFolder.Personal); | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
realPath = Path.Combine(homePath, path.Substring(2)); | realPath = Path.Combine(homePath, path.Substring(2)); | ||
} | } | ||
41行目: | 28行目: | ||
return Path.GetFullPath(realPath); | return Path.GetFullPath(realPath); | ||
} | } | ||
+ | } | ||
</source> | </source> | ||