开发教室
程序设计|Delphi|Java|C++|VB|.NET|Css|Js|PHP|ASP|MySQL|数据库|WEB开发|网页特效|视频
首页 > 开发教室 > 程序设计 > VB > 正文

取得File 8.3之文件名称格式

2007-04-10 源自: 网友评论 0 进入视频教程
 取得File 8.3之文件名称格式


作者: cww 

Private Declare Function GetShortPathName Lib "kernel32" Alias
"GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As
String, ByVal cchBuffer As Long) As Long
Private Declare Function GetFullPathName Lib "kernel32" _
   Alias "GetFullPathNameA" (ByVal lpFileName As String, _
   ByVal nBufferLength As Long, ByVal lpBuffer As String, _
   lpFilePart As Byte) As Long

Private Sub Command1_Click()
Dim aa As Long, pbase As Long
Dim FullPath As String, ShortPath As String
Dim SouStr As String
Dim len5 As Long
Dim fname() As Byte
Dim gg As String
SouStr = "C:vb5.exe"
ShortPath = String(255, 0)
aa = GetShortPathName(SouStr, ShortPath, 256)
SouStr = Left(ShortPath, InStr(1, ShortPath, Chr(0)) - 1)
Debug.Print SouStr
End Sub

上一篇: 取得windows的桌面背景
下一篇:用VB实现特殊图形效果

评论  点击查看
 
开发频道推荐
开发热点文章