路径转换的问题 怎样把如 c:\Program Files\ 这样的路径转换为 c:\Progra~1\ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 '*************************************************************************'**'** 函 数 名:GetShortPath'** 返 回 值:As String'** 参数说明:strFileName,长路径名'** 作 用:将长路径、文件名转换成短路径/文件名'**'*************************************************************************Private Function GetShortPath(strFileName As String) As String Dim lngRes As Long, strPath As String 'Create a buffer strPath = String$(165, 0) 'retrieve the short pathname lngRes = GetShortPathName(strFileName, strPath, 164) 'remove all unnecessary chr$(0)'s GetShortPath = Left$(strPath, lngRes) GetShortPath = Replace(GetShortPath, Chr(0), "")End Function 感谢roger_xiong(卖女孩的小火柴~) 如何用注册表或Setupfactory向程序文件夹和桌面添加快捷方式 再次求助图片修改保存出来后大小会改变的解决方法 vb与SQL连接问题 如何获得msn发送出和接收到的聊天内容? AKillGodKillBuddha 请进! 急﹗在線等待.......怎樣刪除重復的文件﹗ 在VB里用 ScriptingContext 写网页程序为什么不好? 查找字符串中查找指定字符第二次出现的位置?(急,谢谢~~~ VB 数据库,报表问题,期待高手光临! 如何用代码设置ODBC数据源? 进来看看.... 两个字符串比较的问题?
'*************************************************************************
'**
'** 函 数 名:GetShortPath
'** 返 回 值:As String
'** 参数说明:strFileName,长路径名
'** 作 用:将长路径、文件名转换成短路径/文件名
'**
'*************************************************************************
Private Function GetShortPath(strFileName As String) As String
Dim lngRes As Long, strPath As String
'Create a buffer
strPath = String$(165, 0)
'retrieve the short pathname
lngRes = GetShortPathName(strFileName, strPath, 164)
'remove all unnecessary chr$(0)'s
GetShortPath = Left$(strPath, lngRes)
GetShortPath = Replace(GetShortPath, Chr(0), "")
End Function