vb.net get file names in directory?

前端 未结 4 849
灰色年华
灰色年华 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:30

    You will need to use the IO.Directory.GetFiles function.

    Dim files() As String = IO.Directory.GetFiles("c:\")
    
    For Each file As String In files
      ' Do work, example
      Dim text As String = IO.File.ReadAllText(file)
    Next
    

提交回复
热议问题