說明
這就是在Dos底下的短檔名,可以透過GetShortPathName取得,範例程式如下
程式
'這個程式需要一個CommandPrivate Declare Function GetShortPathName Lib "kernel32" Alias"GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath AsString, ByVal cchBuffer As Long) As LongPrivate Declare Function GetFullPathName Lib "kernel32" _ Alias "GetFullPathNameA" (ByVal lpFileName As String, _ ByVal nBufferLength As Long, ByVal lpBuffer As String, _ lpFilePart As Byte) As LongPrivate Sub Command1_Click()Dim aa As Long, pbase As LongDim FullPath As String, ShortPath As StringDim SouStr As StringDim len5 As LongDim fname() As ByteDim gg As StringSouStr = "D:\Program Files\Microsoft Visual Studio\VB98\vb6.exe"ShortPath = String(255, 0)aa = GetShortPathName(SouStr, ShortPath, 256) SouStr = Left(ShortPath, InStr(1, ShortPath, Chr(0)) - 1)Debug.Print SouStrEnd Sub
以上是小编为您精心准备的的内容,在的博客、问答、公众号、人物、课程等栏目也有的相关内容,欢迎继续使用右上角搜索按钮进行搜索string
, as
, function
, V8.3
ByVal
取得资格名称、取得资格名称怎么填、vba取得下拉框的名称、取得低一级资格名称、java取得项目名称,以便于您获取更多的相关知识。
时间: 2024-11-08 21:20:31