本文介绍了递推模块帮助!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这个问题上已经停留了一段时间,因为我收到的大多数示例都给了我一个我不知道如何将其应用于程序的代码.当用户选择C:或D:或E:根目录时,我试图重新扫描我的整个计算机的逻辑驱动器.


我有一个可靠的递推代码,但是在进行扫描时如何使该模块正常工作?

I have been stuck on this subject now for some time because most examples I receive give me a code that I have no idea how to apply to my program. I am trying to recrusivly scan my entire computer''s logical drives when the user selects the C: or D: or E: root directory.


I have a recrusion code that I believe to be correct but how do I get the module to work when the scan is taking place?

Module BrowseFoldersEx  
Sub main()        
Dim direc As New DirectoryInfo("C:\abhishek")        
If direc.Exists = False Then
            MsgBox("The path does not exist. Please specify a correct path")           
 Exit Sub
        End If
        Console.WriteLine("Folders are : ")        
RepeatDir(direc)        
Console.ReadLine()    
End Sub
    Function RepeatDir(ByVal drr As DirectoryInfo)        
Dim fls As DirectoryInfo        
For Each fls In drr.GetDirectories()            
Console.WriteLine(fls.Name)            
RepeatDir(fls)            
Console.WriteLine("Checking for Files:")            RepeatFiles(fls)       
 Next
            End Function
    Function RepeatFiles(ByVal dirs As DirectoryInfo)       
 Dim fl As FileInfo        
For Each fl In dirs.GetFiles()            
Console.WriteLine(fl.Name)       
 Next
        If fl Is Nothing Then
 Console.WriteLine("No files are present in this folder " & dirs.Name)        
End If
    End Function
End Module



有人可以告诉我此代码是否为100%以及在何处以及如何使用吗?

您的专家建议将通过一个简单的链接被接受,因为我已经访问过许多站点,并且需要直截了当的建议和示例.

预先感谢您,希望很快能收到某人或很多人的来信!! :)



Can someone also tell me if this code is 100% and also where and how to use?

Your expert advice will be accepted over a simple link because I have visited many sites allready and need straight foward expinations and examples.

thank you in advance hope to hear from someone or many people soon!!. :)

推荐答案



这篇关于递推模块帮助!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-21 10:22