do not use FileSystemObject, try classes in System.IOWorking with Files and Streams
http://www.vbwm.com/articles/builder/viewer.asp?ArticleID=15Read a Text Files Contents Using System.IO Objects in VB.NET
http://www.freevbcode.com/ShowCode.Asp?ID=2014
http://www.vbwm.com/articles/builder/viewer.asp?ArticleID=15Read a Text Files Contents Using System.IO Objects in VB.NET
http://www.freevbcode.com/ShowCode.Asp?ID=2014
那請哪位能否寫几個例子代碼
Dim di As New DirectoryInfo(Server.MapPath("."))
Dim fiArr As FileInfo() = di.GetFiles()
Response.Write (fiArr.Length)
Server.MapPath(".")): 要求的目录
fiArr 是一个 Array,fiArr.Length 就是文件数了。如果要得到 TXT 档的数目,可以用 di.GetFiles("*.txt")
fiArr 存有该目录底下(找到的)所有文件。
还有,在 asp.net 中切换目录有点奇怪哟...