473,508 Members | 2,295 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Enum files in a network folder

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!
Nov 21 '05 #1
3 6403
"Ed Chiu" <Ed****@discussions.microsoft.com> schrieb:
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
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2
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:\.....".

"Herfried K. Wagner [MVP]" wrote:
"Ed Chiu" <Ed****@discussions.microsoft.com> schrieb:
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
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3
"Dennis" <De****@discussions.microsoft.com> schrieb:
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.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
4572
by: Andreas Huber | last post by:
Hi there Spending half an hour searching through the archive I haven't found a rationale for the following behavior. using System; // note the missing Flags attribute enum Color {
5
3650
by: Mike McIntyre [MVP] | last post by:
I am working on an issue where and ASP.NET web application on one computer (A) needs to access files on a network mapped drive (B). This application uses as DSN on (A) that maps a proprietory...
2
2536
by: Ari | last post by:
hi all, I try to use the shell32 to enum the network adapters that installed on my computer, it works, but I want to get more details about them, such as the device's type, device's name ..., how...
2
3351
by: Rick Strahl [MVP] | last post by:
I'm having problems with installation of a Web app on my Win 2003 server. I copy up the app configure the virtual. But when I access any ASPX pages I now get: CS0016: Could not write to output...
2
6048
by: Tom Wells | last post by:
I have a little file upload page that I have been able to use to successfully upload files to the C: drive of LocalHost (my machine). I need to be able to upload to a network drive from the intranet...
4
11722
by: sajid_yusuf | last post by:
Hi I am trying to develop a Windows service in VB.NET which has timer enabled and keeps checking a folder (or group of folders) for any new file or changed files. As soon as it detects any new...
5
3409
by: rogersw8n | last post by:
Some how, some way the account that creates folders under Temporary Internet files has been changed to a domain account for VS 2003 and VS 2005. I recently installed VS 2005. All seemed to be ok...
1
3861
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
Using .NET 2.0 is it more efficient to copy files to a single folder versus spreading them across multiple folders. For instance if we have 100,000 files to be copied, Do we copy all of them to...
4
1626
Chrisjc
by: Chrisjc | last post by:
Good evening, I was wondering if anyone knew of a way or something to help me out with an issue I been dealing with lately, I have several sites in an Active Directory environment across a WAN....
0
7228
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7128
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7332
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7393
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7058
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4715
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1565
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.