To get file name

How to get the file name from a folder. I want to get all the names of the files available in that folder. How could I achieve this

4 Likes

Hi you can use
directory.getfiles(“Folderpath”)

@soumi_soumiya

1.Use for each activity.
Directory.GetFiles(FolderPath)
2.Then assign
FileName=Path.GetFileName(item.Tostring)

3 Likes

@soumi_soumiya

This will return the file names

3 Likes

thanks for your reply…
what should be the type of variable

image

FolderName is string variable.

3 Likes

Hi @soumi_soumiya,

The variable type is (array of string)

Regards,
gulshiyaa

If you find it useful mark it as solution and close the thread.

Hi @soumi_soumiya,

Below the second parameter is to find specific files with search pattern.So , the below line give you only files starts with “SII” .

Directory.GetFiles(Path,“SII*”)

Thanks and Regards
Krishna

2 Likes

Thanks for your reply…

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.