listbox1 は、ファイルを含むサブフォルダーを一覧表示します。
listbox2 にはファイルリストがあります。
ボタン1を押すと、リストボックス2内のファイルごとにフォルダーが作成され(フォルダー名はファイル名と同じである必要があります)、対応するファイルをそのディレクトリに移動します。
eg)
listbox1
d:\data\sub1\
listbox2
d:\data\sub1\a.7z
d:\data\sub1\ab.7z
when button1 is pushed
we can find the files in...
d:\data\sub1\a\a.7z
d:\data\sub1\ab\a.7z
出来なくて困っています。リストボックスにファイルをリストする方法は知っていますが、それぞれのファイルを処理する方法がわかりません。
また、次のコードでディレクトリ名の 7z 拡張子を取り除こうとすると、リストボックスに使用できないと表示されます。
If folderslist.SelectedItem IsNot Nothing Then
' selected item is filepath
Dim filePath = folderslist.SelectedItem.ToString
The string you are searching
Dim s As String = filePath
Find index of uppercase letter 'B'
Dim i As String = 0
Dim j As String = s.IndexOf("."c)
This new string contains the substring starting at B
part = s.Substring(i, j - i + 1)
If (s.IndexOf(".") = -1) Then
part = "Not found"
End If
アドバイスをお願いします。