03-图像操作/图片自动播放/PicPlay/Form1.cs

(开头部分) 5KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Collections;
namespace PicPlay
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        public bool Pflag;
        int flag = 0;
        FileSystemInfo[] fsinfo;
        ArrayList al = new ArrayList();
        int MM = 0;
        private void splitContainer2_Panel2_Paint(object sender, PaintEventArgs e)
        {

        }

        private void Form1_Load(object sender, EventArgs e)
        {
            cbbShowType.SelectedIndex = 0;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
            {
                al.Clear();
                listBox1.Items.Clear();
                txtPicPath.Text = folderBrowserDialog1.SelectedPath;
                DirectoryInfo di = new DirectoryInfo(txtPicPath.Text);
                fsinfo = di.GetFileSystemInfos();
                for (int i = 0; i < fsinfo.Length; i++)
                {
                    string filename = fsinfo[i].ToString();
                    string filetype = filename.Substring(filename.LastIndexOf(".") + 1, filename.Length - filename.LastIndexOf(".") - 1);
                    filetype = filetype.ToLower();
                    if (filetype == "jpeg" || filetype == "jpg" || filetype == "png" || filetype == "gif" || filetype == "bmp")
                    {
                        listBox1.Items.Add(fsinfo[i].ToString());
                        al.Add(fsinfo[i].ToString());
                        flag++;
                    }
                }
                listBox1.SetSelected(0,true);
                listBox1.Focus();
                tssltotel.Text = "共有"+flag+"张图片";
                Pflag = true;
            }
后面还有 90 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读 AI

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。