多言語度を上げる為にVB.NETに書き換えました。ついでに一番乗りです。
'http://ja.doukaku.org/ 'http://ja.doukaku.org/102/投稿用 Imports System Imports System.Windows.Forms NameSpace どう書く_orgフォルダパス一覧のツリー構造への変換 Class Program <STAThread> _ Shared Sub Main(byval args() As String) Application.Run(new Form1()) End Sub End Class class Form1:Inherits Form 'treeView1 Dim treeView1 As TreeView = New TreeView() '起動時引数でパス一覧のファイルを指定 Dim pathListFilePath As String = System.Environment.GetCommandLineArgs()(1) Public Sub New() 'treeView1 treeView1.Parent = Me treeView1.Dock = DockStyle.Fill End Sub Private Sub Form1_Load(byval sender As object, byval e As EventArgs)handles Me.Load 'ROOTNode Dim rootNode As TreeNode = New TreeNode("ROOT") treeView1.Nodes.Add(rootNode) For Each fullPath As String In System.IO.File.ReadAllLines(pathListFilePath) Dim addNode As TreeNode = rootNode For Each path As String In fullPath.Split(New char(){"\"c}) Dim flag As Boolean = True For Each node As TreeNode in addNode.Nodes If node.Text = path Then addNode = node flag = False End If Next if flag Then Dim newnode As TreeNode = New TreeNode(path) addNode.Nodes.Add(newnode) addNode = newnode End If Next Next rootNode.ExpandAll() End Sub End Class End NameSpace