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

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)

@soumi_soumiya

This will return the file names

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

image

FolderName is string variable.

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

Thanks for your reply…