Vb.net receives the directory list in the specific directory and saves it in a file.txt -


i need create list of existing directory names in specific folder

dim workslist string = application.startuppath + "\db\works.txt"  slctextbox_baseworksdirectory = "c:\listdirectory"    if my.computer.filesystem.directoryexists(slctextbox_baseworksdirectory.text)  saves existing directory names slctextbox_baseworksdirectory.text (c:\listdirectory) in workslist (works.txt)  end if

file works.txt
adirectory1
bdirectory2
cdirectory3
ddirectory4
edirectory5
fdirectory6
gdirectory7

to print existing directories of specific directory file, retrieve files using getdirectories , print using appendalllines. can replace my.computer.filesystem.specialdirectories.mydocuments path directory want list.

    dim directories = my.computer.filesystem.getdirectories(my.computer.filesystem.specialdirectories.mydocuments)      io.file.appendalllines(workslist, directories.select(function(f) f.substring(f.lastindexof("\") + 1))) 

this assumes workslist points valid existing text file.


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -