首页 > TAG信息列表 > GetShortPathName

.NET C#获取指定长路径的短路径方式

直接上代码。 using System.Runtime.InteropServices; [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]        public static extern int GetShortPathName(         [MarshalAs(UnmanagedType.LPTStr)] string path,        

GetShortPathName

#include <windows.h> #include <tchar.h> #include <stdio.h> #define BUFSIZE 4096 #define LONG_DIR_NAME TEXT("c:\\longdirectoryname") void _tmain(int argc, TCHAR* argv[]) { DWORD retval = 0; BOOL success; TCHAR