• 大小: 52KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-10
  • 语言: C#
  • 标签: 相册管理  

资源简介

做项目时做的 一个相片小管家! 有最基本的管理功能,对于初学者 很有用处! 弄回去看一下吧,大家一起上进,壮大中国的软件行业啊!

资源截图

代码片段和文件信息

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

        ArrayList myArraryList=new ArrayList();
        ArrayList myArraryListCur =new ArrayList();
        TimeSpan timeSpan = new TimeSpan();
        private void Form1_Load(object sender EventArgs e)
        {
            
                if (File.Exists(Application.StartupPath + “\\class.dat“))
                {
                    //创建streamReader实例,路径是在当前运行程序的根目录下
                    StreamReader myReadClass = new StreamReader(Application.StartupPath + “\\class.dat“);

                    //定义临时字符串 infoclass用于每次从class.dat中读取一行
                    string infoclass = ““;
                    //判读是不是到文件的末尾
                    while ((infoclass = myReadClass.ReadLine()) != null)
                    {
                        //在类列表框中加入读取到底类名
                        //                             此处应当还有相应的修改
                        lstClass.Items.Add(infoclass);
                    }

                    //关闭文件的读写
                    myReadClass.Close();
                }
            
            //判读图片的信息文件是不是存在,如果存在就读取数据
                if (File.Exists(Application.StartupPath + “\\picdata.dat“))
                
                    {
                        //创建StreamReader实例,路径是在当运行程序的根目录想;
                        StreamReader myReadPicture = new StreamReader(Application.StartupPath + “\\picdata.dat“);

                        //定义临时字符串infoPic用于每次从picdata.dat中读取一行记录
                        string infoPic = ““;

                        //判断是不是到了文件的末尾
                        while ((infoPic = myReadPicture.ReadLine()) != null)
                        {
                            String[] myPictureMessage = infoPic.Split(‘‘);
                            //以”,“分卡读取的信息,并存到数组中;
                            //判断数组是不是等于3(应为每一条图片记录包括了三个层次 每个层次 用‘‘分开)
                            //所以只要用Split(‘‘)方法进行拆分  只要记录格式正确  则可以得到3个元素  长度一定为3
                            //判断数组是不是等于3
                            if (myPictureMessage.Length >= 3)
                            {
                                //向动态数组中加入Picture类的实例
                                this.myArraryList.Add(new Picture(myPictureMessage[2] myPictureMessage[0] myPictureMessage[1]));

                            }
                        }
                        //关闭文件
                        myReadPicture.Close();

                    }
                

            if (this.lstClass.Items.Count > 0)
              {
                //设置类的列表框的默认选项(显示所有相片!(自定义))
                this.lstClass.SelectedIndex = 0;
              }
            if (this.lstPicture.Items.C

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件         26  2009-12-08 16:09  Rj1001_30PictureManage514\PictureManage\bin\Debug\class.dat

     文件        198  2009-12-08 16:09  Rj1001_30PictureManage514\PictureManage\bin\Debug\picdata.dat

     文件      32768  2009-05-15 09:06  Rj1001_30PictureManage514\PictureManage\bin\Debug\PictureManage.exe

     文件      36352  2009-05-15 09:06  Rj1001_30PictureManage514\PictureManage\bin\Debug\PictureManage.pdb

     文件       5632  2005-12-08 14:51  Rj1001_30PictureManage514\PictureManage\bin\Debug\PictureManage.vshost.exe

     文件      17938  2009-05-15 09:50  Rj1001_30PictureManage514\PictureManage\Form1.cs

     文件      17859  2009-05-15 09:50  Rj1001_30PictureManage514\PictureManage\Form1.Designer.cs

     文件       6397  2009-05-15 09:50  Rj1001_30PictureManage514\PictureManage\Form1.resx

     文件        842  2009-05-15 09:06  Rj1001_30PictureManage514\PictureManage\obj\Debug\PictureManage.csproj.GenerateResource.Cache

     文件      32768  2009-05-15 09:06  Rj1001_30PictureManage514\PictureManage\obj\Debug\PictureManage.exe

     文件        180  2009-05-15 09:06  Rj1001_30PictureManage514\PictureManage\obj\Debug\PictureManage.Form1.resources

     文件      36352  2009-05-15 09:06  Rj1001_30PictureManage514\PictureManage\obj\Debug\PictureManage.pdb

     文件        180  2009-05-15 08:56  Rj1001_30PictureManage514\PictureManage\obj\Debug\PictureManage.Properties.Resources.resources

     文件        310  2009-05-14 23:05  Rj1001_30PictureManage514\PictureManage\obj\PictureManage.csproj.FileList.txt

     文件       2546  2009-05-15 09:06  Rj1001_30PictureManage514\PictureManage\obj\PictureManage.csproj.FileListAbsolute.txt

     文件        997  2009-05-08 09:49  Rj1001_30PictureManage514\PictureManage\Picture.cs

     文件       3271  2009-05-08 08:55  Rj1001_30PictureManage514\PictureManage\PictureManage.csproj

     文件        472  2009-05-06 18:27  Rj1001_30PictureManage514\PictureManage\Program.cs

     文件       1198  2009-05-06 18:27  Rj1001_30PictureManage514\PictureManage\Properties\AssemblyInfo.cs

     文件       2880  2009-05-06 18:27  Rj1001_30PictureManage514\PictureManage\Properties\Resources.Designer.cs

     文件       5612  2009-05-06 18:27  Rj1001_30PictureManage514\PictureManage\Properties\Resources.resx

     文件       1096  2009-05-06 18:27  Rj1001_30PictureManage514\PictureManage\Properties\Settings.Designer.cs

     文件        249  2009-05-06 18:27  Rj1001_30PictureManage514\PictureManage\Properties\Settings.settings

     文件        928  2009-05-06 18:27  Rj1001_30PictureManage514\PictureManage.sln

    ..A..H.     21504  2009-05-15 09:50  Rj1001_30PictureManage514\PictureManage.suo

     目录          0  2009-05-31 15:51  Rj1001_30PictureManage514\PictureManage\obj\Debug\Refactor

     目录          0  2009-05-31 15:51  Rj1001_30PictureManage514\PictureManage\obj\Debug\TempPE

     目录          0  2009-05-31 15:51  Rj1001_30PictureManage514\PictureManage\bin\Debug

     目录          0  2009-05-31 15:51  Rj1001_30PictureManage514\PictureManage\obj\Debug

     目录          0  2009-10-20 22:33  Rj1001_30PictureManage514\PictureManage\bin

............此处省略7个文件信息

评论

共有 条评论