VB取得DOS方式的路径地址

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

你可能感兴趣的:(c,String,function,dos,basic,vb)