问:asp.net 跑马灯 怎样从文件夹里读取图片,怎样实现?
答:DirectoryInfo imagesfile = new DirectoryInfo(Server.MapPath("../images/")); Repeater1.DataSource = imagesfile.GetFiles("*.jpg"); Repeater1.DataBind();
引用的时候重要的是路径,路径写成你自己的。
-
Powered by: 博客园 Copyright © 2024 赖鱼塘 Powered by .NET 9.0 on Kubernetes