3
Contributors
3
Replies
11
Views
10 Years
Discussion Span
Last Post by ajit2mail
0

hi
I am working in asp.net,vb.net
I have to copy all files from 1 folder to another folder through coding using system.io

the files in the new folder should remain with the same name

how to do this.

--------------------------------------------------------------------------------

Here is VB code

imports System.io

  Public Shared Sub CopyFlashScriptFile(ByVal SourceDirectory As String, ByVal DestinationDirectory As String)
            Try
                Dim f() As String = Directory.GetFiles(SourceDirectory)
                For i As Integer = 0 To UBound(f)
                    File.Copy(f(i), DestinationDirectory & "\" & fileNameWithoutThePath(f(i)))
                Next
            Catch ex As Exception
            End Try
    End Sub
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.