长文件名转短文件名用,但长文件名中包含中文就只能得到为空的短文件名?

解决方案 »

  1.   

    没有问题啊Private Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As LongPrivate Sub Command1_Click()
    Dim test As String
    test = Space(256)
    GetShortPathName "F:\电影\重庆森林A.rmvb", test, 256
    Debug.Print Trim(test)
    End Sub输出结果:
    F:\电影\重庆森~2.RMV 
    F:\电影\重庆森~2.RMV 
      

  2.   

    楼上的老大,试试这个字符串
    C:\Documents and Settings\Zhang Jiawei\桌面\howto_ftp\howto_ftp
      

  3.   

    哦,忘了,还要加个文件名
    C:\Documents and Settings\Zhang Jiawei\桌面\howto_ftp\howto_ftp\form1.txt
    这样就不行了。
      

  4.   

    哈哈哈啊,果然,楼上楼上说得对,我把FORM1.LOG误以为是FORM1.TXT了,解决了
    散分