Imports System.Data.SqlClient
Imports System.IO.File
Imports System.IO
Module Module1
Sub ListDirectory(ByVal dir As DirectoryInfo)
Console.WriteLine("C:\SS\ ")
Dim f As FileInfo
For Each f In dir.GetFiles()
Console.WriteLine(f.FullName)
IO.File.Delete(f.FullName)
Next
IO.File.Delete("f.FullName")
' list directories and files together from FileSystemInfos
Console.WriteLine("*** Files and directories ***")
Dim fi As FileSystemInfo
End Sub
Sub Main()
Try
Dim dir As New DirectoryInfo("C:\SS\")
Dim fileList() As FileInfo
Dim Limit As Integer
fileList = dir.GetFiles("test*.txt")
For index As Integer = 0 To fileList.Length - 1
Limit = fileList.Length
'''....some parseing
'''.... transfer to sql server
Next
ListDirectory(dir)
Catch ex As Exception
Throw ex
Finally
End Try
End Sub
End Module
Bookmarks