开发者

Directories that exist - Visual Basic 2008

How would I be able to make a variable that holds t开发者_运维知识库he value of the directories that exist in the C:\?


The DirectoryInfo class has member functions to do that - GetDirectories in this case.

Imports System.IO

Dim fTarget As New IO.DirectoryInfo("C:\")
Dim arrAnswer as DirectoryInfo()
arrAnswer = fTarget.GetDirectories()


The simplest option is to call GetDirectories on the static type Directory. This can be found in System.Io. It returns a string array of directories that it finds. You can also specify if it should drill down into subcategories when it is called

See msdn for more info http://msdn.microsoft.com/en-us/library/system.io.directory.getdirectories.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜