vb.net get file names in directory?

前端 未结 4 854
灰色年华
灰色年华 2021-02-19 09:14

I have the following code.

Dim text As String = IO.File.ReadAllText(\"C:\\Example.xtp\")

This code is specific to a single file, however I woul

4条回答
  •  余生分开走
    2021-02-19 09:28

    Try this:

    Dim text As String = ""
    Dim files() As String = IO.Directory.GetFiles(sFolder)
    
    For Each sFile As String In files
        text &= IO.File.ReadAllText(sFile)
    Next
    

提交回复
热议问题