/// <summary>
/// 获取本地信息
/// </summary>
/// <returns></returns>
private List<MHistoryKewWord> GetLocalHistoryKeyWords(){List<MHistoryKewWord> list = new List<MHistoryKewWord>();var fs = new FileStream("data_keywords.bin", FileMode.OpenOrCreate);if (fs.Length > 0){var bf = new BinaryFormatter(); list = bf.Deserialize(fs) as List<MHistoryKewWord>;}fs.Close();return list;
}/// <summary>
/// 保存本地信息
/// </summary>
/// <param name="list"></param>
private void SaveLocalHistoryKeyWords(List<MHistoryKewWord> list)
{if (list != null && list.Count > 0){var fs = new FileStream("data_keywords.bin", FileMode.OpenOrCreate);var bf = new BinaryFormatter();//写入文件bf.Serialize(fs, list);//关闭fs.Close();}
}/// <summary>
/// 信息实体类
/// </summary>
[Serializable]
public class MHistoryKewWord
{public string KeyWord { get; set; }public DateTime LastTime { get; set; }
}