|
Nobody will be able to write your code for you unless you want to give somebody full access to your server. Otherwise the best any of us can do is point you in the right direction.
If you only want to access one file, you don't need ( or want ) a for loop. You don't need a do loop, either. The whole point of a loop is you want to do something an unknown number of times. You want to do something once. So no loop.
Again, the code you need is:
If myFolder.Files.Count > 0 Then x = myFolder.Files(0)
Where x is a local string variable. Then you do something with x. We don't know what, because we can't see the rest of your code. You might want to response.write it, you might want to form an img or a tag around it, you might want to send it to a control.
There's no end if because this doesn't span multiple lines.
|