Enum files in a network folder

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I want to use VB.Net to access a network folder, say \\myServer\myFolder,
and enumerate all files in that folder and process each file one by one.
Please provide some sample codes.

Thanks!
 
Ed Chiu said:
I want to use VB.Net to access a network folder, say \\myServer\myFolder,
and enumerate all files in that folder and process each file one by one.

I didn't check if it works with network folders, but it's worth a try:

\\\
Imports System.IO
..
..
..
Dim Files() As String = Directory.GetFiles("\\MyServer\MyFolder")
For Each FileName As String In Files
Debug.WriteLine(FileName)
Next FileName
///
 
Herfried, it works..I use network folders as well as some mapped drives and
they both work with all the VB.Net classes like FileInfo, Directory, etc just
as if they were "c:\.....".
 
Dennis said:
Herfried, it works..I use network folders as well as some mapped drives
and
they both work with all the VB.Net classes like FileInfo, Directory, etc
just
as if they were "c:\.....".

Thank you for confirming that.
 
Back
Top