Visual Basic Code |
Private Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" ( ByVal lpszLongPath As String, _ ByVal lpszShortPath As String, ByVal cchBuffer As Long ) As Long Private Sub Form_Load ( ) MsgBox GetDOSPath ( "C:/Documents And Settings/Administrator/桌面" ) End Sub Private Function GetDOSPath ( WinPath As String ) As String Dim DosPath As String Dim DosPathSize As Long DosPathSize = GetShortPathName ( WinPath, vbNullString, 0 ) DosPath = String ( DosPathSize, " " ) GetShortPathName WinPath, DosPath, DosPathSize GetDOSPath = DosPath End Function |
VB取得DOS方式的路径地址
最新推荐文章于 2025-05-28 22:18:33 发布