16,554
社区成员
发帖
与我相关
我的任务
分享
Imports System.Runtime.InteropServices
Module Module1
<DllImport("kernel32.dll", CharSet:=CharSet.Auto, SetLastError:=True)> _
Function GetShortPathName(<[In]()> ByVal path As Char(), <Out()> ByVal shortPathBuffer As Char(), ByVal bufferLength As Integer) As Integer
End Function
Sub Main()
Dim p As String = "C:\Users\huanghaic\Desktop\1111\GenDoUtil\DEComPressTemp\1700_0_TFTM_3_AH_2015081801.zip"
Dim shortPathBuffer As Char() = New Char(260) {}
Dim n As Integer = GetShortPathName(p, shortPathBuffer, 260)
p = Left(shortPathBuffer, n)
Console.WriteLine(n)
Console.WriteLine(p)
Console.ReadLine()
End Sub
End Module