Show files from 2 different folders in a single Gridview

后端 未结 3 580
滥情空心
滥情空心 2021-01-26 08:08

Is it possible to show files from 2 different folders (c:\\test1 and c:\\test2) in the same gridview?

I work in VB.net (VS 2010)

Thanks!

3条回答
  •  Happy的楠姐
    2021-01-26 08:56

    Try something like this:

    Dim files As New List(Of String)()
    files.AddRange(GetAllFilesFromDir("C:\foo")) 
    files.AddRange(GetAllFilesFromDir("C:\bar"))
    'GetAllFilesFromDir() must return IEnumerable string
    gv.DataSource = files
    gv.DataBind()
    
    
        
            
                
                    
                
            
        
    
    

    You hadn't shown your code in your question, so the above example demonstrates how this might be done generally.

提交回复
热议问题