日期:2014-05-17 浏览次数:20854 次
public List<SysDisk> DeserializeList(bool Ready, bool Failed, bool Online, bool Other)
{
string path = OutFile + @"\Disk.bin";
IFormatter formatter = new BinaryFormatter();
FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read);
fs.Seek(0, 0);
infoList = formatter.Deserialize(fs) as List<SysDisk>;//拿到数据的list
List<SysDisk> DiskList = new List<SysDisk>();//填充筛选数据的list
foreach (SysDisk item in infoList)
{
SysDisk disk = new SysDisk();
if (Ready == true && Failed == true && Online == true && Other == true)
{
disk.IP = item.IP;
disk.diskno = item.diskno;
disk.diskname = item.diskname;
disk.diskstates = item.diskstates;
disk.diskSerial = item.diskSerial;
disk.SpareState = item.SpareState;
disk.RollUpStatus = item.RollUpStatus;
disk.ComponentStatus = item.ComponentStatus;
disk.UpdateTime = item.UpdateTime;
DiskList.Add(disk);
}
else if (Ready == true && Failed == true)
{
if (item.diskstates == "Ready" || item.diskstates == "Failed")
{
disk.IP = item.IP;
&