问题: 32位程序在64位系统上调用GetModuleFileNameEx()遍历获取64位进程的全路径失败,得到的路径都为空. 根据官方的说法: For the best results use the following table to convert paths. Windows 2000 = GetModuleFileNameEx() Windows XP x32 = GetProcessImageFileName() Windows XP x64 = GetProcessImageF…
string s = Environment.CurrentDirectory; //需添加Forms.DLL s = System.Windows.Forms.Application.StartupPath; s = System.Windows.Forms.Application.ExecutablePath; s = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName; s = System.Reflecti…
//读取目录 下的所有非隐藏文件夹或文件 public List<FileItem> GetList(string path) { int i; string[] folders = Directory.GetDirectories(path); string[] files = Directory.GetFiles(path); List<FileItem> list = new List<FileItem>(); foreach (string s in folde…