How to convert ShortPath to longPath?

  • Thread starter Thread starter yxq
  • Start date Start date
Declare Auto Function GetLongPathName Lib "kernel32.dll" _
(ByVal lpszShortPath as string, ByVal lpszLongPath as stringbuilder, ByVal
cchBuffer as integer) _
as Integer
Public Function ToLongPathName (shortName as String) as String
Dim longNameBuffer as New StringBuilder(256)
Dim BufferSize as Integer = longNameBuffer.Capacity
GetLongPathName(shortName, longNameBuffer, bufferSize)
Return longNameBuffer.ToString()
End Function
 
Thank you very much.

Dennis said:
Declare Auto Function GetLongPathName Lib "kernel32.dll" _
(ByVal lpszShortPath as string, ByVal lpszLongPath as stringbuilder, ByVal
cchBuffer as integer) _
as Integer
Public Function ToLongPathName (shortName as String) as String
Dim longNameBuffer as New StringBuilder(256)
Dim BufferSize as Integer = longNameBuffer.Capacity
GetLongPathName(shortName, longNameBuffer, bufferSize)
Return longNameBuffer.ToString()
End Function
 
Back
Top