Click here to Skip to main content
15,896,348 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Thanks Corrina but,,, Pin
Corinna John8-Jan-04 0:53
Corinna John8-Jan-04 0:53 
GeneralRe: Thanks Corrina but,,, Pin
Ian Darling8-Jan-04 0:59
Ian Darling8-Jan-04 0:59 
GeneralBut about groupbox... Pin
Het21098-Jan-04 2:55
Het21098-Jan-04 2:55 
GeneralRe: But about groupbox... Pin
Ian Darling8-Jan-04 3:07
Ian Darling8-Jan-04 3:07 
GeneralActiveX Dll project in Visual Basic.net Pin
iluha7-Jan-04 10:21
iluha7-Jan-04 10:21 
GeneralRe: ActiveX Dll project in Visual Basic.net Pin
iluha7-Jan-04 12:17
iluha7-Jan-04 12:17 
GeneralI Need Help Copying Files Pin
BrianReeve7-Jan-04 8:49
BrianReeve7-Jan-04 8:49 
GeneralRe: I Need Help Copying Files Pin
iluha7-Jan-04 9:40
iluha7-Jan-04 9:40 
Here is some code that will go through the directory copy you files.


Option Explicit


Private Const MAX_PATH = 260
Private Const FILE_ATTRIBUTE_DIRECTORY = &H10
Private Const INVALID_HANDLE_VALUE = -1

Private Type FileTime
dwLowDateTime As Long
dwHighDateTime As Long
End Type

Private Type WIN32_FIND_DATA
dwFileAttributes As Long
ftCreationTime As FileTime
ftLastAccessTime As FileTime
ftLastWriteTime As FileTime
nFileSizeHigh As Long
nFileSizeLow As Long
dwReserved0 As Long
dwReserved1 As Long
cFileName As String * MAX_PATH
cAlternate As String * 14
End Type

Private Declare Function CopyFile Lib "kernel32" Alias "CopyFileA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal bFailIfExists As Long) As Long
Private Declare Function FindFirstFile Lib "kernel32" Alias "FindFirstFileA" (ByVal lpFileName As String, lpFindFileData As WIN32_FIND_DATA) As Long
Private Declare Function FindNextFile Lib "kernel32" Alias "FindNextFileA" (ByVal hFindFile As Long, lpFindFileData As WIN32_FIND_DATA) As Long
Private Declare Function FindClose Lib "kernel32" (ByVal hFindFile As Long) As Long

Private Sub Form_Load()
On Error Resume Next
Dim hSearch&, FileData As WIN32_FIND_DATA, aFolderName$
hSearch& = FindFirstFile("\\server\clients\*.*", FileData)
If hSearch& <> INVALID_HANDLE_VALUE Then
Do
If FileData.dwFileAttributes And FILE_ATTRIBUTE_DIRECTORY Then
aFolderName$ = Mid$(FileData.cFileName, 1, InStr(1, FileData.cFileName, vbNullChar) - 1)
Select Case aFolderName$
Case ".", ".." 'skip
Case Else
CopyFile "\\server\clients\" & aFolderName$ & "\diagram.htm", "\\server\network_diagram\" & aFolderName$ & "\diagram.htm", True
End Select
End If
FileData.cFileName = ""
Loop While FindNextFile(hSearch&, FileData)
FindClose (hSearch&)
End If
End Sub

Sleepy | :zzz:


iluha
GeneralRe: I Need Help Copying Files Pin
BrianReeve7-Jan-04 10:06
BrianReeve7-Jan-04 10:06 
GeneralShell Or Other command to open a file. Pin
jlizardo7-Jan-04 3:55
jlizardo7-Jan-04 3:55 
GeneralRe: Shell Or Other command to open a file. Pin
jlizardo7-Jan-04 4:04
jlizardo7-Jan-04 4:04 
GeneralRe: Shell Or Other command to open a file. Pin
Niels Penneman8-Jan-04 7:34
Niels Penneman8-Jan-04 7:34 
GeneralRe: Shell Or Other command to open a file. Pin
jlizardo8-Jan-04 8:25
jlizardo8-Jan-04 8:25 
GeneralRe: Shell Or Other command to open a file. Pin
Niels Penneman8-Jan-04 10:27
Niels Penneman8-Jan-04 10:27 
GeneralRe: Shell Or Other command to open a file. Pin
jlizardo9-Jan-04 3:10
jlizardo9-Jan-04 3:10 
GeneralVB.NET Database connections Pin
marclaz6-Jan-04 23:51
marclaz6-Jan-04 23:51 
GeneralRe: VB.NET Database connections Pin
Marcie Jones7-Jan-04 9:44
Marcie Jones7-Jan-04 9:44 
Generalwat is the code for matrix function(math) Pin
vnistelrooy6-Jan-04 22:30
vnistelrooy6-Jan-04 22:30 
GeneralListView repainting problem Pin
Niels Penneman6-Jan-04 11:03
Niels Penneman6-Jan-04 11:03 
QuestionHow to install kbd hook in VB Pin
Vivek Jain6-Jan-04 7:41
Vivek Jain6-Jan-04 7:41 
GeneralMulti level binding with Datagrid Pin
DC@Home6-Jan-04 6:05
DC@Home6-Jan-04 6:05 
QuestionIs the Screensaver running? Pin
Roidzo6-Jan-04 4:20
Roidzo6-Jan-04 4:20 
AnswerRe: Is the Screensaver running? Pin
Dave Kreskowiak6-Jan-04 9:40
mveDave Kreskowiak6-Jan-04 9:40 
GeneralRe: Is the Screensaver running? Pin
Roidzo6-Jan-04 17:47
Roidzo6-Jan-04 17:47 
GeneralRe: Is the Screensaver running? Pin
Dave Kreskowiak7-Jan-04 5:03
mveDave Kreskowiak7-Jan-04 5:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.