473,320 Members | 1,993 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,320 software developers and data experts.

system.io

Hi,

How di enumerate through files in a given directory?

Thanks
ZR
Nov 20 '05 #1
4 1315
* "maft" <zv******@hotmail.donotspam> scripsit:
How di enumerate through files in a given directory?


\\\
Dim s As String
For Each s in Directory.GetFiles(...)
MsgBox(s)
Next s
///

Recursive enumeration:

<http://www.mvps.org/dotnet/dotnet/samples/filesystem/downloads/RecursiveFileScan.zip>

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
Nov 20 '05 #2
The following is a code sample I used:

Dim strArchivo, strHref, strVirtualParam As String

Dim strArrArchivos As String()

strArrArchivos = IO.Directory.GetFiles(strPathActualParam)

For Each strArchivo In strArrArchivos

strHref = strVirtual & "/" & strArchivo.Remove(0,
strPathActualParam.Length + 1)

MyLiteral.Text += "<a href='" & strHref & "'>" & strEspacio &
strArchivo.Remove(0, strPathActualParam.Length + 1) & "<BR>"

Next

"maft" <zv******@hotmail.donotspam> escribió en el mensaje
news:eA**************@TK2MSFTNGP11.phx.gbl...
Hi,

How di enumerate through files in a given directory?

Thanks
ZR

Nov 20 '05 #3
Thanks alot it works.

I am trying to delete multiple files in a particular directory.
The code will like this
\\\
Dim s As String
For Each s in Directory.GetFiles(...)
system.io.file.delete(s)
Next s
///

is there a method that would allow me delete more than one file at a time.

for instance Delete "*.txt"

ZR

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bo*************@ID-208219.news.uni-berlin.de...
* "maft" <zv******@hotmail.donotspam> scripsit:
How di enumerate through files in a given directory?
\\\
Dim s As String
For Each s in Directory.GetFiles(...)
MsgBox(s)
Next s
///

Recursive enumeration:

<http://www.mvps.org/dotnet/dotnet/sa...s/RecursiveFil
eScan.zip>
--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>

Nov 20 '05 #4
Thanks alot
zr

"Gustavo De la Espriella" <qq@qqq.qq.qq> wrote in message
news:eq**************@TK2MSFTNGP11.phx.gbl...
The following is a code sample I used:

Dim strArchivo, strHref, strVirtualParam As String

Dim strArrArchivos As String()

strArrArchivos = IO.Directory.GetFiles(strPathActualParam)

For Each strArchivo In strArrArchivos

strHref = strVirtual & "/" & strArchivo.Remove(0,
strPathActualParam.Length + 1)

MyLiteral.Text += "<a href='" & strHref & "'>" & strEspacio &
strArchivo.Remove(0, strPathActualParam.Length + 1) & "<BR>"

Next

"maft" <zv******@hotmail.donotspam> escribió en el mensaje
news:eA**************@TK2MSFTNGP11.phx.gbl...
Hi,

How di enumerate through files in a given directory?

Thanks
ZR


Nov 20 '05 #5

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

Similar topics

3
by: Terrence | last post by:
I am doing some of the C# walkthroughs to transition from VB to C#. When I try to execute static void Main() { Aplication.Run(new Form1()) } I raise a 'System.NullReferenceException" in...
2
by: Scott | last post by:
Not sure if this is the right place to post this or not, but I am in the process of trying to find a Web Hosting/Isp Billing system that is reasonable in price and uses Access or SQL Server for a...
0
by: muralidharan | last post by:
WebForm1.aspx Code: <%@ Register TagPrefix="ComponentArt" Namespace="ComponentArt.Web.UI" Assembly="ComponentArt.Web.UI" %> <ComponentArt:TreeView id="TreeView1" Height="520"...
5
by: laks | last post by:
Hi I have the following xsl stmt. <xsl:for-each select="JOB_POSTINGS/JOB_POSTING \"> <xsl:sort select="JOB_TITLE" order="ascending"/> This works fine when I use it. But when using multiple...
0
by: NicK chlam via DotNetMonster.com | last post by:
this is the error i get System.Data.OleDb.OleDbException: Syntax error in INSERT INTO statement. at System.Data.Common.DbDataAdapter.Update(DataRow dataRows, DataTableMapping tableMapping) at...
1
by: Sky | last post by:
Yesterday I was told that GetType(string) should not just be with a Type, but be Type, AssemblyName. Fair enough, get the reason. (Finally!). As long as it doesn't cause tech support problems...
3
by: forest demon | last post by:
for example, let's say I do something like, System.Diagnostics.Process.Start("notepad.exe","sample.txt"); if the user does a SaveAs (in notepad), how can i capture the path that the user...
1
by: mfunkmann | last post by:
Hi, I recently got an error and I don't know how to fix it: Error 1 'System.Data.DataColumn' does not contain a definition for 'Windows' C:\c#\CsharpPRO\Form1.Designer.cs 304 77 CsharpPRO I...
2
by: =?Utf-8?B?TmF0aGFuIFdpZWdtYW4=?= | last post by:
Hi, I am wondering why the .NET Framework is quite different from Win32 API when it comes to displaying system modal message boxes. Consider the four following types of system modal message...
3
by: Mike | last post by:
Hi I have problem as folow: Caught Exception: System.Configuration.ConfigurationErrorsException: An error occurred loading a configuration file: Request for the permission of type...
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
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
1
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)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...

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.