Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Quick Copy Program
Author:
Shrinivas Deshpande
E-mail:
Click to e-mail author
Submitted:
9/29/2007
Version:
VB6
Compatibility:
VB6
Category:
File Manipulation
Views:
10664
No copy no paste just select to copy, select to delete.
Declarations:
Dim FSys As New FileSystemObject
Code:
Private Sub Combo1_Change() File1.Pattern = Combo1.Text End Sub Private Sub Command1_Click() Form2.Show End Sub Private Sub Dir1_Change() File1.Path = Dir1.Path End Sub Private Sub Drive1_Change() On Error GoTo this Dir1.Path = Drive1.Drive this: If Err.Number > 0 Then MsgBox ("Device not ready") End If End Sub Private Sub File1_Click() Dim FSys As New FileSystemObject If Right(File1.Path, 1) = "\" Then yourfile = File1.Path + File1.FileName Else yourfile = File1.Path + "\" + File1.FileName End If FSys.CopyFile yourfile, "f:\backup\" Label1.Caption = File1.FileName + " is copied " File2.Refresh End Sub Private Sub File1_Mouseup(Button As Integer, Shift As Integer, X As Single, Y As Single) Label2.ForeColor = vbWhite End Sub Private Sub File1_Mousedown(Button As Integer, Shift As Integer, X As Single, Y As Single) Label2.ForeColor = vbCyan End Sub Private Sub File2_Mouseup(Button As Integer, Shift As Integer, X As Single, Y As Single) Label3.ForeColor = vbWhite End Sub Private Sub File2_Mousedown(Button As Integer, Shift As Integer, X As Single, Y As Single) Label3.ForeColor = vbCyan End Sub Private Sub File2_Click() Dim FSys As New FileSystemObject If Right(File2.Path, 1) = "\" Then yourfile2 = File2.Path + File2.FileName Else yourfile2 = File2.Path + "\" + File2.FileName End If Label1.Caption = File2.FileName + " is deleted " FSys.DeleteFile yourfile2 File2.Refresh End Sub Private Sub Form_Load() On Error GoTo this1 Drive1.Drive = "C:" Dir1.Path = "c:\Documents and Settings\Srinivas\My Documents" File2.Path = "f:\backup\" this1: If Err.Number > 0 Then MsgBox ("F:\backup folder doesn't exist,to continue creat this folder.") End End If File2.Refresh End Sub Private Sub Timer1_Timer() Label4.ForeColor = (Rnd() + 500) * 500 End Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement