📄 peutil.cs
字号:
namespace PowerEasy.Controls.Editor
{
using System;
using System.Collections;
using System.IO;
public sealed class PEUtil
{
private PEUtil()
{
}
public static DirectoryInfo CreateDirectory(string path)
{
ArrayList list = new ArrayList();
DirectoryInfo parent = new DirectoryInfo(Path.GetFullPath(path));
while ((parent != null) && !parent.Exists)
{
list.Add(parent.FullName);
parent = parent.Parent;
}
if (parent == null)
{
throw new DirectoryNotFoundException("Directory \"" + list[list.Count - 1] + "\" not found.");
}
for (int i = list.Count - 1; i >= 0; i--)
{
string str = (string) list[i];
int num2 = NativeMethods._mkdir(str);
if (num2 != 0)
{
throw new FileNotFoundException(string.Concat(new object[] { "Error calling [msvcrt.dll]:_wmkdir(", str, "), error code: ", num2 }));
}
}
return new DirectoryInfo(path);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -