flash.tato
Member
- Joined
- Aug 26, 2006
- Messages
- 8
- Programming Experience
- Beginner
I need merging into one file container many file.
But they must be merged in alphabetical order.
I tried using SortedFileList but it doesn't work
and i don't understand why
The code is
------------------------------------------------------------------------
But i don't understand why doesn't it merge files in alphabetical order?!
How do i solve it?!
But they must be merged in alphabetical order.
I tried using SortedFileList but it doesn't work
The code is
------------------------------------------------------------------------
VB.NET:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
TextBox2.Text = "Software opened!!!"
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If FolderBrowserDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
TextBox1.Text = FolderBrowserDialog1.SelectedPath
TextBox2.Text = "Directory selected!!!"
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
If TextBox1.Text = "" Then
TextBox2.Text = "Error!No Directory selected"
Else
Dim SortedFileList As New SortedList
For Each item As String In My.Computer.FileSystem.GetFiles(Me.TextBox1.Text, FileIO.SearchOption.SearchTopLevelOnly, "*.gif")
SortedFileList.Add(item, item)
Next
For Each item As String In My.Computer.FileSystem.GetFiles(Me.TextBox1.Text, FileIO.SearchOption.SearchTopLevelOnly, "*.gif")
For Each s1 As String In SortedFileList
My.Computer.FileSystem.WriteAllBytes(s1, My.Computer.FileSystem.ReadAllBytes(item), True)
TextBox2.Text = "File Container Building!!!"
Next
TextBox2.Text = "File Container Made!!!"
Next
End If
End If
End Sub
End Class
But i don't understand why doesn't it merge files in alphabetical order?!
How do i solve it?!