473,327 Members | 2,094 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,327 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 1767
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.