问:[url=http://www.knowsky.com/asp.asp]asp.net 跑马灯 怎样从文件夹里读取图片,怎样实现?
答:
DirectoryInfo imagesfile = new DirectoryInfo(Server.MapPath("../images/"));
Repeater1.DataSource = imagesfile.GetFiles("*.jpg");
Repeater1.DataBind();
引用的时候重要的是路径,路径写成你自己的。
问:[url=http://www.knowsky.com/asp.asp]asp.net 跑马灯 怎样从文件夹里读取图片,怎样实现?
答:
DirectoryInfo imagesfile = new DirectoryInfo(Server.MapPath("../images/"));
Repeater1.DataSource = imagesfile.GetFiles("*.jpg");
Repeater1.DataBind();
引用的时候重要的是路径,路径写成你自己的。