• 大小: 0.94M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2020-12-26
  • 语言: C#
  • 标签: winform  图片  

资源简介

读取某个目录下的所有图片,并听过 picturebox循环播放

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace TailorFamilyAlbum
{
    public partial class Frm_Main : Form
    {
        string strPath;
        string strInfo=““;
        string[] strName=null;
        int Num = 0;
        int Count = 0;
        public Frm_Main()
        {
            InitializeComponent();
            strPath = System.Environment.CurrentDirectory+“\\Image“;
        }

        public void GetAllFiles(DirectoryInfo dir)
        {
            FileSystemInfo[] fileinfo = dir.GetFileSystemInfos();  //初始化一个FileSystemInfo类型的数组
            foreach (FileSystemInfo i in fileinfo)  //循环遍历fileinfo中的每一个记录
  

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2013-04-30 22:40  TailorFamilyAlbum\
     目录           0  2011-12-22 23:11  TailorFamilyAlbum\TailorFamilyAlbum\
     文件         941  2013-04-30 22:39  TailorFamilyAlbum\TailorFamilyAlbum.sln
     文件       15872  2010-11-04 18:51  TailorFamilyAlbum\TailorFamilyAlbum.suo
     文件       28160  2013-04-30 22:43  TailorFamilyAlbum\TailorFamilyAlbum.v11.suo
     目录           0  2011-12-22 23:11  TailorFamilyAlbum\TailorFamilyAlbum\bin\
     目录           0  2013-04-30 22:39  TailorFamilyAlbum\TailorFamilyAlbum\bin\Debug\
     目录           0  2011-12-22 23:11  TailorFamilyAlbum\TailorFamilyAlbum\bin\Debug\Image\
     文件      102814  2007-07-11 19:22  TailorFamilyAlbum\TailorFamilyAlbum\bin\Debug\Image\1.jpg
     文件      105038  2007-07-11 19:22  TailorFamilyAlbum\TailorFamilyAlbum\bin\Debug\Image\2.jpg
     文件      176074  2007-07-11 19:22  TailorFamilyAlbum\TailorFamilyAlbum\bin\Debug\Image\3.jpg
     文件      197920  2007-07-11 19:22  TailorFamilyAlbum\TailorFamilyAlbum\bin\Debug\Image\4.jpg
     文件      116002  2007-07-11 19:22  TailorFamilyAlbum\TailorFamilyAlbum\bin\Debug\Image\5.jpg
     文件       93139  2007-07-11 19:22  TailorFamilyAlbum\TailorFamilyAlbum\bin\Debug\Image\6.jpg
     文件       92021  2007-07-11 19:22  TailorFamilyAlbum\TailorFamilyAlbum\bin\Debug\Image\7.jpg
     文件      169675  2007-07-11 19:22  TailorFamilyAlbum\TailorFamilyAlbum\bin\Debug\Image\8.bmp
     文件       10240  2013-04-30 22:39  TailorFamilyAlbum\TailorFamilyAlbum\bin\Debug\TailorFamilyAlbum.exe
     文件       24064  2013-04-30 22:39  TailorFamilyAlbum\TailorFamilyAlbum\bin\Debug\TailorFamilyAlbum.pdb
     文件        3305  2010-07-10 21:37  TailorFamilyAlbum\TailorFamilyAlbum\Frm_Main.cs
     文件        4261  2010-07-09 16:58  TailorFamilyAlbum\TailorFamilyAlbum\Frm_Main.designer.cs
     文件        5814  2010-07-09 16:58  TailorFamilyAlbum\TailorFamilyAlbum\Frm_Main.resx
     目录           0  2011-12-22 23:11  TailorFamilyAlbum\TailorFamilyAlbum\obj\
     目录           0  2013-04-30 22:39  TailorFamilyAlbum\TailorFamilyAlbum\obj\Debug\
     文件        7194  2013-04-30 22:39  TailorFamilyAlbum\TailorFamilyAlbum\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
     目录           0  2011-12-22 23:11  TailorFamilyAlbum\TailorFamilyAlbum\obj\Debug\Refactor\
     文件        2586  2013-04-30 22:39  TailorFamilyAlbum\TailorFamilyAlbum\obj\Debug\TailorFamilyAlbum.csproj.FileListAbsolute.txt
     文件         850  2013-04-30 22:39  TailorFamilyAlbum\TailorFamilyAlbum\obj\Debug\TailorFamilyAlbum.csproj.GenerateResource.Cache
     文件        1757  2013-04-30 22:39  TailorFamilyAlbum\TailorFamilyAlbum\obj\Debug\TailorFamilyAlbum.csprojResolveAssemblyReference.cache
     文件       10240  2013-04-30 22:39  TailorFamilyAlbum\TailorFamilyAlbum\obj\Debug\TailorFamilyAlbum.exe
     文件         180  2013-04-30 22:39  TailorFamilyAlbum\TailorFamilyAlbum\obj\Debug\TailorFamilyAlbum.Frm_Main.resources
     文件       24064  2013-04-30 22:39  TailorFamilyAlbum\TailorFamilyAlbum\obj\Debug\TailorFamilyAlbum.pdb
............此处省略11个文件信息

评论

共有 条评论