资源简介
北大青鸟S2C#.NET项目电影售票管理系统,带详细注释和解题思路,值得参考!
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System.Windows.Forms;
namespace CinemaManager
{
///
/// 电影院类,保存放映计划与座位类
///
[Serializable]
public class Cinema
{
public Cinema()
{
schedule = new Schedule();
seats = new Dictionary();
soldTickets = new List();
}
///
/// 放映计划
///
private Schedule schedule;
public Schedule Schedule
{
get { return schedule; }
set { schedule = value; }
}
///
/// 座位集合
///
private Dictionary seats;
public Dictionary Seats
{
get { return seats; }
set { seats = value; }
}
///
/// 己售出电影票集合
///
private List soldTickets;
public List SoldTickets
{
get { return soldTickets; }
set { soldTickets = value; }
}
///
/// 序列化
///
public void Save()
{
FileStream fs = new FileStream(“cinema.bin“FileMode.Create);
BinaryFormatter bf = new BinaryFormatter();
bf.Serialize(fs soldTickets);
fs.Close();
}
///
/// 反序列化
///
public void Load()
{
try
{
FileStream fs = new FileStream(“cinema.bin“ FileMode.Open);
BinaryFormatter bf = new BinaryFormatter();
soldTickets = ((List)bf.Deserialize(fs));
fs.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
soldTickets = new List();
}
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 899 2009-08-19 17:50 OOP项目实战\MovieList.xm
文件 928 2009-07-16 22:49 OOP项目实战\CinemaManager\CinemaManager.sln
..A..H. 34816 2009-08-28 17:47 OOP项目实战\CinemaManager\CinemaManager.suo
文件 569533 2007-10-26 11:49 OOP项目实战\CinemaManager\pic\bone.jpg
文件 8376 2007-10-25 15:52 OOP项目实战\CinemaManager\pic\gongfu.jpg
文件 8686 2007-10-26 11:49 OOP项目实战\CinemaManager\pic\spiderman3.jpg
文件 2175 2009-08-19 11:52 OOP项目实战\CinemaManager\CinemaManager\Cinema.cs
文件 3806 2009-08-19 10:34 OOP项目实战\CinemaManager\CinemaManager\CinemaManager.csproj
文件 168 2009-07-30 15:08 OOP项目实战\CinemaManager\CinemaManager\CinemaManager.csproj.user
文件 240 2009-07-17 13:01 OOP项目实战\CinemaManager\CinemaManager\IPrintable.cs
文件 12433 2009-08-28 17:27 OOP项目实战\CinemaManager\CinemaManager\MainForm.cs
文件 23406 2009-08-19 15:45 OOP项目实战\CinemaManager\CinemaManager\MainForm.Designer.cs
文件 6183 2009-08-19 15:45 OOP项目实战\CinemaManager\CinemaManager\MainForm.resx
文件 1972 2009-08-19 09:15 OOP项目实战\CinemaManager\CinemaManager\Movie.cs
文件 316 2009-07-17 15:03 OOP项目实战\CinemaManager\CinemaManager\MovieType.cs
文件 1832 2009-08-19 10:43 OOP项目实战\CinemaManager\CinemaManager\PresentTicket.cs
文件 475 2009-07-16 22:49 OOP项目实战\CinemaManager\CinemaManager\Program.cs
文件 4192 2009-08-19 09:54 OOP项目实战\CinemaManager\CinemaManager\Schedule.cs
文件 932 2009-08-19 09:27 OOP项目实战\CinemaManager\CinemaManager\ScheduleItem.cs
文件 835 2009-07-30 15:07 OOP项目实战\CinemaManager\CinemaManager\Seat.cs
文件 1677 2009-08-19 11:26 OOP项目实战\CinemaManager\CinemaManager\StudentTicket.cs
文件 2218 2009-08-19 11:25 OOP项目实战\CinemaManager\CinemaManager\Ticket.cs
文件 871 2009-08-19 10:42 OOP项目实战\CinemaManager\CinemaManager\TicketFactory.cs
文件 1198 2009-07-16 22:49 OOP项目实战\CinemaManager\CinemaManager\Properties\AssemblyInfo.cs
文件 2848 2009-07-17 15:31 OOP项目实战\CinemaManager\CinemaManager\Properties\Resources.Designer.cs
文件 5612 2009-07-16 22:49 OOP项目实战\CinemaManager\CinemaManager\Properties\Resources.resx
文件 1109 2009-07-17 15:31 OOP项目实战\CinemaManager\CinemaManager\Properties\Settings.Designer.cs
文件 249 2009-07-16 22:49 OOP项目实战\CinemaManager\CinemaManager\Properties\Settings.settings
文件 313 2009-08-28 17:22 OOP项目实战\CinemaManager\CinemaManager\obj\CinemaManager.csproj.FileList.txt
文件 845 2009-08-19 20:52 OOP项目实战\CinemaManager\CinemaManager\obj\Debug\CinemaManager.csproj.GenerateResource.Cache
............此处省略28个文件信息
评论
共有 条评论