Click here to Skip to main content
15,895,192 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: calculating the size of all the files present in a folder Pin
Colin Angus Mackay27-Jul-06 16:12
Colin Angus Mackay27-Jul-06 16:12 
GeneralRe: calculating the size of all the files present in a folder [modified] Pin
Tyquaun Hunter27-Jul-06 16:39
Tyquaun Hunter27-Jul-06 16:39 
GeneralRe: calculating the size of all the files present in a folder Pin
harish13927-Jul-06 19:27
harish13927-Jul-06 19:27 
QuestionConvert Binary Data to comma delimited text string Pin
VK-Cadec27-Jul-06 1:57
VK-Cadec27-Jul-06 1:57 
AnswerRe: Convert Binary Data to comma delimited text string Pin
RichardBerry27-Jul-06 2:52
RichardBerry27-Jul-06 2:52 
GeneralRe: Convert Binary Data to comma delimited text string Pin
Guffa27-Jul-06 7:26
Guffa27-Jul-06 7:26 
QuestionHowTo copy a folder with its contents to a target folder? Pin
Zaegra27-Jul-06 1:13
Zaegra27-Jul-06 1:13 
AnswerRe: HowTo copy a folder with its contents to a target folder? [modified] Pin
Tyquaun Hunter27-Jul-06 16:37
Tyquaun Hunter27-Jul-06 16:37 
Try this. It is a two step process.

1. Create your destination directory with the same name as your source directory.
2. Get all of the files in your source directory and copy it over to your newly created destination directory.

* Note: You should prompt the user that destination directory already exists and if it does, give them an option to overwrite it. If not, it will overwrite automatically. Also, you should prompt the user that the file exist that you are about to overwrite. I just bypass existing files. You might have to perform some other types of error handling, but fundamentally, everything you need is there.

Good Luck

Public Shared Sub CopyEntireDirectory(ByVal SourceDir As String, ByVal DestinationDir As String)
'Create Directory
Directory.CreateDirectory(DestinationDir)
'Declare a variable to recieve file name
Dim FileName As String
'Iterate through source directory
For Each FileName In Directory.GetFiles(SourceDir)
'Copy file with each iteration as long as the file does not exist
If File.Exists(DestinationDir & GetFileName(FileName)) = False Then
File.Copy(FileName, DestinationDir & GetFileName(FileName))
End If
Next
End Sub

Tyquaun


-- modified at 22:54 Thursday 27th July, 2006
GeneralRe: HowTo copy a folder with its contents to a target folder? Pin
Zaegra27-Jul-06 21:06
Zaegra27-Jul-06 21:06 
GeneralRe: HowTo copy a folder with its contents to a target folder? Pin
Zaegra27-Jul-06 21:11
Zaegra27-Jul-06 21:11 
AnswerRe: HowTo copy a folder with its contents to a target folder? Pin
Tyquaun Hunter28-Jul-06 4:27
Tyquaun Hunter28-Jul-06 4:27 
GeneralRe: HowTo copy a folder with its contents to a target folder? Pin
Zaegra5-Aug-06 21:07
Zaegra5-Aug-06 21:07 
GeneralRe: HowTo copy a folder with its contents to a target folder? Pin
Tyquaun Hunter10-Aug-06 15:57
Tyquaun Hunter10-Aug-06 15:57 
GeneralRe: HowTo copy a folder with its contents to a target folder? Pin
Zaegra16-Aug-06 22:45
Zaegra16-Aug-06 22:45 
QuestionBind a data set in an HTML table Pin
coolpali_girl27-Jul-06 0:30
coolpali_girl27-Jul-06 0:30 
AnswerRe: Bind a data set in an HTML table Pin
Tyquaun Hunter27-Jul-06 18:01
Tyquaun Hunter27-Jul-06 18:01 
GeneralRe: Bind a data set in an HTML table Pin
coolpali_girl29-Jul-06 0:57
coolpali_girl29-Jul-06 0:57 
GeneralRe: Bind a data set in an HTML table Pin
Tyquaun Hunter31-Jul-06 4:28
Tyquaun Hunter31-Jul-06 4:28 
GeneralRe: Bind a data set in an HTML table Pin
MalikRizwan31-Jul-06 18:55
MalikRizwan31-Jul-06 18:55 
QuestionRadix Sort Pin
faaisaal26-Jul-06 23:46
faaisaal26-Jul-06 23:46 
AnswerRe: Radix Sort Pin
Guffa27-Jul-06 1:16
Guffa27-Jul-06 1:16 
QuestionCalculation based on a formula entered in a text box Pin
RichardBerry26-Jul-06 22:24
RichardBerry26-Jul-06 22:24 
AnswerRe: Calculation based on a formula entered in a text box Pin
Dave Sexton26-Jul-06 22:54
Dave Sexton26-Jul-06 22:54 
GeneralRe: Calculation based on a formula entered in a text box Pin
RichardBerry26-Jul-06 23:42
RichardBerry26-Jul-06 23:42 
GeneralRe: Calculation based on a formula entered in a text box Pin
Dave Sexton27-Jul-06 1:06
Dave Sexton27-Jul-06 1:06 

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.