Dim FL As New List(Of String)
Public Sub ContAdd(ByVal FName As String)
If FL.Contains(FName) = False Then
FL.Add(FName)
End If
End Sub
Public Function ExteJudge(ByVal FN As String) As Boolean
If System.IO.Path.HasExtension(FN) = False Then Return True
Dim Extes() As String = {".ai", ".eps"}
Dim Exte As String = String.Empty
For Each Exte In Extes
If Exte = System.IO.Path.GetExtension(FN) Then
Return True
End If
Next
Return False
End Function
Sub Main(ByVal Fs() As String)
FL.Clear()
Dim files As String()
For Each FName As String In Fs
If GetAttr(FName) = FileAttribute.Directory Then
files = System.IO.Directory.GetFiles(FName)
For Each FileName As String In files
If ExteJudge(FileName) = True Then
ContAdd(FileName)
End If
Next
Else
If ExteJudge(FName) = True Then
ContAdd(FName)
End If
End If
Next
If FL.Count = 0 Then
Console.WriteLine("適切なファイルが選択されていません")
Exit Sub
End If
End Sub