Ú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!
- Vezeték nélküli fülhallgatók
- BestBuy ruhás topik
- BestBuy topik
- RGB-s, LCD-kijelzős VGA-tartó olcsón? Hol kell aláírni?
- Samsung Galaxy A54 - türelemjáték
- HTPC (házimozi PC) topik
- One otthoni szolgáltatások (TV, internet, telefon)
- Videós, mozgóképes topik
- Autós topik látogatók beszélgetős, offolós topikja
- EAFC 26
- További aktív témák...
- Toshiba Enterprise Capacity MG09 18TB - 512MB, 7200rpm, SATA3 - 100/100 -as - Eladó!
- Akció! Gamer PC-Számítógép! Csere-Beszámítás! R5 1600X / RX 580 8GB / 500GB SSD + 2TB HDD / 16GB RAM
- SOYO M4 Air Mini PC, Intel N95, 16 GB DDR4 RAM, 512 GB SSD
- Új Lenovo LOQ 15IRX10, FHD IPS, i7-13650HX ,NVIDIA RTX 5070, 24GB DDR5, 512GB NVMe, gar
- HÁLÓZATI SWITCH AKCIÓ! Több db egyben, használt, nem használt , dobozos, 24-, 26-, 48 portos!
- Apple iPhone 14 Pro 256GB, Kártyafüggetlen, 1 Év Garanciával
- iKing - Apple iPhone 15 Pro Natural Titanium ProMotion 120 Hz, A17 Pro, USB-C 128 GB
- Samsung Galaxy S24 FE 128GB, Kártyafüggetlen, 1 Év Garanciával
- Okosóra felvásárlás!! Samsung Galaxy Watch 6, Samsung Galaxy Watch 7, Samsung Galaxy Watch Ultra
- Honor 200 Lite 256GB, Kártyafüggetlen, 1 Év Garanciával
Állásajánlatok
Cég: Central PC számítógép és laptop szerviz - Pécs
Város: Pécs
Cég: Laptopműhely Bt.
Város: Budapest

