Jump to content
ÐÒ&

Sortare fisiere

Recommended Posts

Posted

Imports System.IO
Imports System.IO.directoryinfo
Module Module1
Function Redenumire(ByVal director As String, ByVal nume As String, ByVal extensie As String)
Dim dir As New IO.DirectoryInfo(director)
Dim fisiere As IO.FileInfo() = dir.GetFiles("*." & extensie)
Dim fisier As IO.FileInfo
For Each fisier In fisiere
fisier.MoveTo(director & "\" & nume & "." & extensie)
Next
End Function
End Module

Codul imi apartine si as vrea sa il explic.

io.directoryinfo e un tip de date abstract..definit de platforma .NET....ea va fi stocata in dir.

io.fileinfo deasemenea...se poate observa ca avemj metoda de preluare fisiere din dir(cel cu structura aia de mai sus)

restu e de inteles.move to pur si simplu il muta adica aplica operatiile cut paste..si cam atat..astfel vom avea fisierele de tip extensie din folderul respectiv sortate sub un anume nume.bun pt SEO.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...