高手看看,写入流没有错吧!
using System;using System.Collections.Generic;
using System.Text;
using
namespace Accp
{
//赠票
[Serializable]
public class FreeTicket:Ticket,IPrintable
{
// public FreeTicket() { }
public FreeTicket(string customername,Seat seat,ScheduleItem scheduleItem)
:base(seat,scheduleItem)
{
this._customerName = customername;
}
//获得票者的名字
private string _customerName;
public string CustomerName
{
get { return _customerName; }
set { _customerName = value; }
}
public override void CalcPrice()
{
this.Price = 0;
}
public override void Print()
{
string fileName = this.Scheduleitem.Time + "" + Seat.SeatNum + ".txt";
FileStream fs = new FileStream(fileName,http://www.);
StreamWriter sw = new StreamWriter(fs);
sw.WriteLine("**********************************");
sw.WriteLine("青鸟影院(赠票)");
sw.WriteLine("----------------------------------");
sw.WriteLine("电影名:\t{0}", this.Scheduleitem.Movie.MovieName);
sw.WriteLine("时间:\t{0}", this.Scheduleitem.Time);
sw.WriteLine("座位号:\t{0}", this.Seat.SeatNum);
sw.WriteLine("价格:\t{0}", this.Price.ToString());
sw.WriteLine("**********************************");
sw.Close();
}
}
}
[ 本帖最后由 ganmaoaq 于 2009-8-17 07:37 编辑 ]