Új hozzászólás Aktív témák
-
wwlaci
csendes tag
válasz
Gregorius
#1014
üzenetére
Szia!
találtam egy ilyen megoldást, de nem tudom, hogyan tudom
megjeleníteni ennek az eredményét listboxban.Imports System.Collections
Imports System.IO
Imports System
Public Class Form1Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End SubPrivate Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
End Sub
End ClassPublic NotInheritable Class Directory
Public Class RecursiveFileProcessorPublic Overloads Shared Sub Main(ByVal args() As String)
Dim path As String
For Each path In args
If File.Exists(path) Then
' This path is a file.
ProcessFile(path)
Else
If System.IO.Directory.Exists(path) Then
' This path is a directory.
ProcessDirectory(path)
Else
Console.WriteLine("{0} is not a valid file or directory.", path)
End If
End If
Next path
End Sub 'Main' Process all files in the directory passed in, recurse on any directories
' that are found, and process the files they contain.
Public Shared Sub ProcessDirectory(ByVal targetDirectory As String)
Dim fileEntries As String() = System.IO.Directory.GetFiles(targetDirectory)
' Process the list of files found in the directory.
Dim fileName As String
For Each fileName In fileEntries
ProcessFile(fileName)Next fileName
Dim subdirectoryEntries As String() = System.IO.Directory.GetDirectories(targetDirectory)
' Recurse into subdirectories of this directory.
Dim subdirectory As String
For Each subdirectory In subdirectoryEntries
ProcessDirectory(subdirectory)
Next subdirectoryEnd Sub 'ProcessDirectory
' Insert logic for processing found files here.
Public Shared Sub ProcessFile(ByVal path As String)
Console.WriteLine("Processed file '{0}'.", path)
End Sub 'ProcessFile
End Class 'RecursiveFileProcessor
End Class
Új hozzászólás Aktív témák
● ha kódot szúrsz be, használd a PROGRAMKÓD formázási funkciót!
- Lenovo ThinkPad X13 G2 13.3" -50% AMD Ryzen 5 Pro 5650U Hexa-core 16GB 512GB SSD FHD
- Gaming PC - R5 9600X,RTX 5070 12GB,32GB DDR5,1TB NVMe,850W
- Ultra PC - R7 7800X3D,RTX 5080 16GB,32GB DDR5,1TB NVMe,1200W
- Uhh Lenovo ThinkPad P15 G2 Tervező Vágó Laptop -75% 15,6" i5-11500H 32/1TB RTX A2000 4GB /1 Millió/
- Lenovo Legion 5 15ARH05H - Gamer Laptop
- MacBook Pro 13, 14, 15, 16, MacBook Air M1, M2 M3 M4 bill magyarosítás lézerrel / sapkacserével
- 137 - Lenovo Legion Pro 7 (16IRX9H) - Intel Core i9-14900HX, RTX 4080 - 4 ÉV GARANCIA!
- ÁRCSÖKKENTÉS MacBook Pro 17" i7 2.6 GHz 8GB RAM 8 ciklus az akkuban!
- Dell Latitude 5320 - hibás kijelzők - i5 1135G7 ,16GB RAM, SSD, jó akku, számla
- Byski Áramláskijelző.
Állásajánlatok
Cég: Laptopszaki Kft.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest


