Hi Guys,
The code below works fine, however I would like to know if there is a faster method ?
It's not so slow but If I can do faster...
As per the code above, I would like to do something like the code below, but a message appears "Variable 'dra' is used before it has been assigned a value. A null reference exception could result at runtime"Code:Dim sProjectName As String = sProjectNumber + "*.apj" Dim di As New IO.DirectoryInfo(sSearchPath) Dim diar1() As IO.FileInfo = di.GetFiles(sProjectName, IO.SearchOption.AllDirectories) Dim dra As IO.FileInfo For Each dra In diar1 sTempFile = dra.FullName.ToString() Next
Thanks in advance !Code:If dra.Length() > 0 Then For Each dra In diar1 sTempFile = dra.FullName.ToString() Next End If


Reply With Quote