需要引用using System.IO;   

string path = HttpContext.Current.Server.MapPath("/WebApplication1/news/");
   DirectoryInfo fileinfo=new DirectoryInfo(path);
   FileInfo[] filename=fileinfo.GetFiles();
   for(int i=0;i<filename.Length;i++)
   {
    this.Label1.Text+="<a href='news/"+filename[i].Name+"'>"+filename[i].Name+"</a><br>";
   }

相关文章:

  • 2021-09-30
  • 2021-05-26
  • 2022-12-23
  • 2022-12-23
  • 2021-12-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-05-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案