求完整的VB复制或移动文件到指定目录下

 我来答
xmcolong
2010-11-29 · 超过17用户采纳过TA的回答
知道答主
回答量:55
采纳率:0%
帮助的人:28.7万
展开全部
我一个程序里的一段,供你参考一下:
Option Explicit
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Declare Function GetActiveWindow Lib "user32" () As Long
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
Dim DestDir, StrScan, nFile As String
Dim n As Integer
Dim i As Integer
Dim ff() As String
Dim fn As Long
List1.Clear
If KeyCode = 13 Then
StrScan = Text1.Text
DestDir = App.path & "\" & "batch" & Right(Val(1000 + m), 3) & "\"
If InStr(StrScan, "-GNR") Then
nFile = Left(StrScan, Len(StrScan) - 4) & "*_OutputModel_SLA.stl"
Else
nFile = StrScan & "*_OutputModel_SLA.stl"
End If
fn = FileList(App.path, nFile, ff())
For i = 1 To fn
List1.AddItem ff(i)
FileCopy ff(m), DestDir & ff(i)
Kill ff(i)
Next
End If
Text1.SetFocu
Text1.SelStart = 0
Text1.SelLength = Len(Text1)
End Sub
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式