VB 将长路径转为短路径 & 获取剪粘板中的文件的列表
将长路径转为短路径
Private Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long
Private Function ShortPath(ByVal FileName As String) As String
Dim S As String
On Error GoTo exitFunc:
S = String(255, " ")
GetShortPathName FileName, S, 255
ShortPath = Left(S, InStr(S, Chr(0)) - 1)
exitFunc:
End Function
获取剪粘板中的图片文件的列表
Private Const CF_HDROP = 15
Private Type POINT
x As Long
y As Long
End Type
Private Type DROPFILES
pFiles As Long
pt As POINT
fNC As Long
fWide As Long
End Type
Private Declare Function GlobalSize Lib "kernel32" _
(ByVal hMem As Long) As Long
Private Declare Function GlobalLock Lib "kernel32" _
(ByVal hMem As Long) As Long
Private Declare Function GlobalUnlock Lib "kernel32" _
(ByVal hMem As Long) As Long
Private Declare Function OpenClipboard Lib "user32" _
(ByVal hwnd As Long) As Long
Private Declare Function CloseClipboard Lib "user32" () As Long
Private Declare Function GetClipboardData Lib "user32" _
(ByVal wFormat As Long) As Long
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory"
相关文档:
1.用VB6判断文件存在妙法
在编程时经常会用到判断文件是否存在,比如对文件做读写操作前,或是判断密钥文件是否存在等。判断的方法有很多,有些方法虽很实用,但有点繁琐。其实还可以有更简单的方法,就是使用VB 6.0提供的FileSystemObject对象。
FileSystemObject对象不是VB内置对象,使用前必须首先选择[工程]&rar ......
我用VB执行DOS命令,生成文本文件随即打开
但是由于文本文件生成需要一段时间,
还未等文件生成完毕VB就打开了这个文件
请问如何让程序等待DOS命令执行完毕再打开这个文本文件啊
最好还能加上一个等待的进度条显示文本文件的生成过程
代码如下:
Shell "cmd /c dir /s /b e:\ dir.txt"
Open "dir.txt" ......
DB2ConnectionString
b2str = "Provider=MSDASQL.1;Password=a$sk6G7;Persist Security Info=True;User ID=DBA;Data Source=ConDB2SFXXK"
AccessConnectonString
accessstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\DMSJK.mdb;Jet OLEDB:database password=" ......
最近刚学会在VB2008 中使用参数化SQL语句,于是马上用到代码中,却碰到查不到任何数据的情况,纠结了好几天,还是没有搞明白,差点吐血。不得已还是先在代码中使用字符串拼接的SQL语句。
包含参数化SQL语句的代码如下:
Dim cmSl As N ......
'******************************************************************************************
'* 需要注意的问题 *
'******************************************************************************************
'1.INI文件的路 ......