⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 如何获得文件在dos状态下的短文件名.txt

📁 VB技巧问答10000例 VB技巧问答10000例
💻 TXT
字号:
你 可 以 使 用 GetShortPathName将 长 文 件 名 转 换 为 DOS短 文 件 名 。 该 函 数 定 义 为 : 
     Declare Function GetShortPathName Lib "kernel32" _ 
     Alias "GetShortPathNameA" (ByVal lpszLongPath As String, _ 
     ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long 
    你 可 以 用 下 面 这 个 函 数 : 
     Public Function GetShortName(ByVal sLongFileName As String) As String 
     Dim lRetVal As Long, sShortPathName As String, iLen As Integer 
     'Set up buffer area for API function call return 
     sShortPathName = Space(255) 
     iLen = Len(sShortPathName) 
     
     'Call the function 
     lRetVal = GetShortPathName(sLongFileName, sShortPathName, iLen) 
     'Strip away unwanted characters. 
     GetShortName = Left(sShortPathName, lRetVal) 
     End Function 
<END>     

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -