Hi,In solution explore sub folder contain image files (OR) files .How to get filename and how to access through my coding part.
Give replay as early as possible.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Kirtan PatelPosted Oct 31, 2009, 3:52 AM
lokesh muppanaPosted Oct 31, 2009, 3:44 AM
protocaol:not available
address:not avaliable
size: not avaliable
string path = Server.MapPath("MyFiles").ToString();
string[] FileNames = Directory.GetFiles(path);
Image1.ImageUrl = Server.MapPath("MyFiles").ToString() + @"\" + FileNames[0];
Image2.ImageUrl = Server.MapPath("MyFiles").ToString() + @"\" + FileNames[1];
Image3.ImageUrl = Server.MapPath("Myfiles").ToString() + @"\" + FileNames[2];
Image4.ImageUrl = Server.MapPath("MyFiles").ToString() + @"\" + FileNames[3];
foreach (string s in FileNames)
{
Response.Write(s);
Response.Write("
");
}
-----------------------------------------------------------------------------------------------------------------------------------------------------
Kirtan PatelPosted Oct 31, 2009, 3:09 AM
Friend,
check "Do you like this answer" please :)
you should Write like below
Image1.ImageUrl =Server.MapPath("MyFiles").ToString() +@"\"+FileNames[0];lokesh muppanaPosted Oct 31, 2009, 3:01 AM
--------------------------------------------------------------------
string path = Server.MapPath("MyFiles").ToString();
string[] FileNames = Directory.GetFiles(path);
Image1.ImageUrl =FileNames[0];
Image2.ImageUrl =FileNames[1];
Image3.ImageUrl =FileNames[2];
Image4.ImageUrl =FileNames[3];
foreach (string s in FileNames)
{
Response.Write(s);
Response.Write("
");
}
-----------------------------------------------------------------------
lokesh muppanaPosted Oct 31, 2009, 1:42 AM
Thanks.
Kirtan PatelPosted Oct 31, 2009, 1:18 AM
you can get FileNames in List With Below Code
using System.IO;
string path = Server.MapPath("images").ToString();
string[] FileNames = Directory.GetFiles(path);
lokesh muppanaPosted Oct 31, 2009, 1:15 AM
By using FTP ,so many people are uploading images in a imagefloder.i do not know what imagenames are using and uploading in my imagefloder.i know only imagefloder.How to get the imagefile names and stored in string arrray data type.
Kirtan PatelPosted Oct 31, 2009, 12:54 AM
Suppose you have image in images folder and image name is test.jpg
then
you can access it like below code
string path = Server.MapPath("images").ToString() + @"\test.jpg";
Response.Write(path);
Image1.ImageUrl = path;
if my answer helps you "Check Do you like this answer" please :)