如果我们选择目录,请阅读文件路径,大小名称 [英] HOw to read the file path,size names if we select directory

查看:71
本文介绍了如果我们选择目录,请阅读文件路径,大小名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

if (dirinfo.exists)
  //{
  //    filesinthisfolder = dirinfo.getfiles().count();
  //}
  //if (includesubfolders)
  //{
  //    //filesinthisfolder += dirinfo.getdirectories().sum(di => button1_click(di));
  //    //return filesinthisfolder;
  //}
         
 FileInfo[] filearr = dirinfo.GetFiles();

 foreach (FileInfo f1 in filearr)
 {
   for (int i = 0; i < 1; i++)
   {
     SqlConnection conn = new SqlConnection();

     string name = f1.Name;
     conn = new SqlConnection(ConfigurationManager.ConnectionStrings["sqlCon"].ToString());//Sql database connection written in web.config file
     conn.Open();
     SqlCommand cmd;
     try
     {
     }

推荐答案

可能会在以下链接中填满您的要求

https://msdn.microsoft.com/en-us/library/k3352a4t(v = vs.110).aspx [ ^ ]
May be below link full fill your requirement
https://msdn.microsoft.com/en-us/library/k3352a4t(v=vs.110).aspx[^]


这篇关于如果我们选择目录,请阅读文件路径,大小名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆