API方式 获取Windows下的 Windows目录和 Windows/System32目录
来源:互联网 发布:录音软件没有声音 编辑:程序博客网 时间:2024/05/17 05:19
//声明API
/// <summary>
/// 获取系统的System32目录
/// </summary>
/// <param name="lpBuffer"></param>
/// <param name="nSize"></param>
/// <returns></returns>
[DllImport("kernel32", EntryPoint = "GetSystemDirectoryA", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
public static extern long GetSystemDirectory(StringBuilder lpBuffer, long nSize);
/// <summary>
/// 获取系统的Windows目录
/// </summary>
/// <param name="lpBuffer"></param>
/// <param name="nSize"></param>
/// <returns></returns>
[DllImport("kernel32", EntryPoint = "GetWindowsDirectoryA", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
public static extern long GetWindowsDirectory(StringBuilder lpBuffer, long nSize);
//调用
public string GetSystemPath()
{
StringBuilder p = new StringBuilder(100);
long length;
length = GetSystemDirectory(p, 100);
return p.ToString();
}
public string GetWindowsPath()
{
StringBuilder p = new StringBuilder(100);
long length;
length = GetWindowsDirectory(p, 100);
return p.ToString();
}
- API方式 获取Windows下的 Windows目录和 Windows/System32目录
- Windows System32目录下所有文件详解
- Windows System32目录下所有文件详解
- Windows/System32目录下所有文件详解
- 使用windows API函数获取目录下所有文件名---目录下文件的扫描和处理
- Windows下的SysWow64和System32
- Windows下获取目录大小
- windows 下获取当前目录
- Windows系统System32目录的访问权限问题
- 获取系统目录和Windows目录
- jsp获取当前目录下的文件和目录,获取windows盘符
- jsp获取当前目录下的文件和目录,获取windows盘符
- jsp获取当前目录下的文件和目录,获取windows盘符
- jsp获取当前目录下的文件和目录,获取windows盘符
- Windows API获取硬件信息与目录
- 在Windows中获取指定目录的API函数SHGetSpecialFolderPath
- windows api 读取目录下所有文件
- Windows 下目录的遍历
- java中文问题
- xp安装了SP3以后无法更新的解决办法
- XRRGetScreenInfo
- jsp文件上传组建的使用
- HardDuplicateRemover
- API方式 获取Windows下的 Windows目录和 Windows/System32目录
- C#.NET中关于结构与类之间的区别(很详细,看了才知不后悔)
- 几个小游戏——防御塔游戏
- 请求参数中的中文读取问题
- Java容器类List和Set比较
- RequestDispatcher.include方法
- servlet的部署
- 底层开发应注意的若干问题
- 小伎俩又拿出来骗人了