您的位置:首页 > 编程语言 > VB

VB取得DOS方式的路径地址

2008-09-20 18:44 281 查看
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: