473,408 Members | 2,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Slow response on file directory

Hi

The following code came be very slow in getting
creation time,filename,file length and directoryname
for files in a subdirectory because it keeps checking
each file sequentially in a slow DSL connection

Does anybody know how I can speed things? One suggestion
was to get the remote server to only bring back
creation time,filename,file length and directoryname of all
files in a subdirectory newer than a certain date, all in one shot.

_old code
Private Sub CheckPeMCopiedFilesAgainstDB()
Dim PemDir As IO.DirectoryInfo
Dim SubDir As IO.DirectoryInfo
Dim TypeDir As IO.DirectoryInfo
Dim PemFile As IO.FileInfo
Dim dtFiles As DataTable
dtFiles = CreateFileTable()
Dim drFile As DataRow
Dim dv As DataView

Dim ds As New DataSet()
Dim dtMaintDB As DataTable

Try
PemDir = New
IO.DirectoryInfo(Configuration.ConfigurationSettin gs.AppSettings.Item("pem_copies_file_path"))

For Each SubDir In PemDir.GetDirectories()
For Each TypeDir In SubDir.GetDirectories
For Each PemFile In TypeDir.GetFiles()
If PemFile.CreationTime >
Convert.ToDateTime(txtPemDate.Text) Then
drFile = dtFiles.NewRow
drFile("Folder") =
PemFile.DirectoryName
drFile("Create Date") =
PemFile.CreationTime
drFile("File Name") = PemFile.Name
drFile("Size") = PemFile.Length
dtFiles.Rows.Add(drFile)
End If
Next
Next
Next
Jul 21 '05 #1
1 1772
Not too sure if this will help, but you might want to look at the
DirectoryInfo.GetFileSystemInfos
method.
Returns an array of strongly typed FileSystemInfo entries listing all the
files and directories
"Dennis English" <de************@yahoo.com> wrote in message
news:fe**************************@posting.google.c om...
Hi

The following code came be very slow in getting
creation time,filename,file length and directoryname
for files in a subdirectory because it keeps checking
each file sequentially in a slow DSL connection

Does anybody know how I can speed things? One suggestion
was to get the remote server to only bring back
creation time,filename,file length and directoryname of all
files in a subdirectory newer than a certain date, all in one shot.

_old code
Private Sub CheckPeMCopiedFilesAgainstDB()
Dim PemDir As IO.DirectoryInfo
Dim SubDir As IO.DirectoryInfo
Dim TypeDir As IO.DirectoryInfo
Dim PemFile As IO.FileInfo
Dim dtFiles As DataTable
dtFiles = CreateFileTable()
Dim drFile As DataRow
Dim dv As DataView

Dim ds As New DataSet()
Dim dtMaintDB As DataTable

Try
PemDir = New
IO.DirectoryInfo(Configuration.ConfigurationSettin gs.AppSettings.Item("pem_copies_file_path"))

For Each SubDir In PemDir.GetDirectories()
For Each TypeDir In SubDir.GetDirectories
For Each PemFile In TypeDir.GetFiles()
If PemFile.CreationTime >
Convert.ToDateTime(txtPemDate.Text) Then
drFile = dtFiles.NewRow
drFile("Folder") =
PemFile.DirectoryName
drFile("Create Date") =
PemFile.CreationTime
drFile("File Name") = PemFile.Name
drFile("Size") = PemFile.Length
dtFiles.Rows.Add(drFile)
End If
Next
Next
Next

Jul 21 '05 #2

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

Similar topics

8
by: BlueBall | last post by:
I am writing some kind of network testing tool and I have wrote the following code in ASP.NET with C# int size= 10048576; // around 10 MB data string buffer = ""; for (int j=1; j<=1024;...
4
by: Vito DeCarlo | last post by:
Over the past week, I've been noticing that any websites (on this one particular web server) built with ASP.NET have unusually slow (5 second) response times when moving through the site. There...
2
by: Sven Thorsen | last post by:
I have a Web Service with a method that handles file uploads. The file is sent as a DIME attachment to the SOAP request. The post is successful, the file is received and the correct response is...
6
by: MadMan2004 | last post by:
Hello all! I'm having a problem with a project I'm working on and I'd like to ask for anyone's input that might be helpful. I'm building a rather large front-end application connecting to an...
1
by: Dennis English | last post by:
Hi The following code came be very slow in getting creation time,filename,file length and directoryname for files in a subdirectory because it keeps checking each file sequentially in a slow...
3
by: LSloan | last post by:
Hi, I have an Access application installed on a network server that is accessed by several users. It isn't split into a front-end/back-end (I know it should be but when I've tried, the response...
14
by: teslar91 | last post by:
As a fairly new .NET coder, I would greatly appreciate some comments on any .NET classes that are known to be notoriously slow by comparison to direct API calls. I've already had a bad...
13
by: =?Utf-8?B?S2VzdGZpZWxk?= | last post by:
Hi Our company has a .Net web service that, when called via asp.net web pages across our network works 100%! The problem is that when we try and call the web service from a remote machine, one...
2
by: gnomee2 | last post by:
Hello Everyone, I have a strange problem that I cannot seem to solve. I have two server running Windows 2003 MSSQL on one IIS on the other. Out of the blue I have slow queries that cause asp...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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...

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.