我如何在硬盘驱动器中列出文件夹中的文件 [英] How I list a file in folder exist in hard drive

查看:55
本文介绍了我如何在硬盘驱动器中列出文件夹中的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用vb.net,我使用文件夹浏览器来选择硬盘中的文件夹,我想列出所有文件存在于所选文件夹中,但我不知道我将如何做到这一点

这是我的代码(只是如何选择文件夹)



 dossier_disque.ShowDialog()
txt_folder.Text = dossier_disque.SelectedPath





dossier_disque是文件夹浏览器名称



我尝试了什么:



i尝试在硬盘中选择一个文件夹

解决方案

尝试:

 Dim files As String()= Directory.GetFiles(path)



Directory.GetFiles Method(String)(System.IO) [ ^ ] - 你然后可以以您认为适合您的应用的任何方式显示它们。

With vb.net , i used a folderbrowser for to choose a folder in hard drive , and i want to list all file exist in folder selected , but i don't know how i will do that
This is my code (just how to choose a folder)

dossier_disque.ShowDialog()
txt_folder.Text = dossier_disque.SelectedPath



dossier_disque is folderbrowser name

What I have tried:

i try to choose a folder in hard drive

解决方案

Try:

Dim files As String() = Directory.GetFiles(path)


Directory.GetFiles Method (String) (System.IO)[^] - you can then display them in any way you find suitable for your application.


这篇关于我如何在硬盘驱动器中列出文件夹中的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆