-
WEB遍历文件夹下所有的文件(不遍历文件夹)
-
-
-
-
- public void ListFiles(string pathtext)
- {
- try
- {
-
- if (pathtext == null ||pathtext.Equals(""))
- {
- Response.Write("路径不能为空错误");
- }
- else
- {
-
- string[] filename = Directory.GetFiles(Server.MapPath(pathtext));
-
- int a = 0;
-
- long j = 0;
-
- foreach (string file in filename)
- {
-
- DateTime CreationTime = File.GetCreationTime(file);
-
-
- Response.Write(file+"file<br/>");
-
- FileInfo f = new FileInfo(file);
- long len = f.Length;
- Response.Write(len.ToString()+"文件大小<br/>");
- j = j + len;
- a++;
- }
-
- Response.Write (a.ToString()+"文件个数<br/>");
- int i = a;
-
- long x = j /1024;
- Response.Write(x.ToString() + "KB 文件大小<br/>");
- Response.Write("搜索完毕!系统提示<br/>");
- }
- }
- catch
- {
- Response.Write("请检查路径是否正确");
- }
- }
-
相关阅读:
Python 数据结构_队列
Python 数据结构_堆栈
基于SAP的中国式数据分析浅谈
基于SAP的中国式数据分析浅谈
logstash 处理nginx 错误日志
logstash nginx 访问日志
其中 (%{WORD:x_forword}|-) |表示或的意思
grok 官方文档
vCenter 部件关系简介 & 网络原理
haproxy nginx 多路径
-
原文地址:https://www.cnblogs.com/dingdingmao/p/3146586.html
Copyright © 2020-2023
润新知