Public Function GetRandomFile() As String
Dim files As String() = System.IO.Directory.GetFiles(MapPath(Request.ApplicationPath), "*.aspx")
Dim rnd As New Random()
Dim rndFile As String = files(rnd.Next(files.Length))
Return System.IO.Path.GetFileName(rndFile)
End Function
获取当前目录下的所有文件
最新推荐文章于 2024-04-08 08:58:47 发布