印尼穆斯林教派:访问文件夹下的文件示例

来源:百度文库 编辑:中财网 时间:2024/04/29 21:59:05
 public string GetImage()
        {
            string mapth = Server.MapPath("./images");
            string str = string.Empty;
            try
            {
                DirectoryInfo dirinfo = new DirectoryInfo(mapth);
                FileInfo[] infos = dirinfo.GetFiles();
                if (infos != null)
                {
                    foreach(var item in infos)
                    {
                        str += "
\n\"Swimming\n

\"Swimming pool near our house\"

\n
\n";
                    }
                }                return str;
            }
            catch
            {
               
                throw;
            }        }