Tuesday, 27 August 2013

Directory.GetFiles string gives an error

Directory.GetFiles string gives an error

I am creating a website using asp.net and c#
I need to access all files one by one in a directory. So I wrote the
following code.
string[] ssImgs = Directory.GetFiles("images/movies");
Label1.Text = ssImgs[0];
Label2.Text = ssImgs[1];
But it gives an error. What is the correct way to do this? Thanks in advance.

No comments:

Post a Comment