Beispiel #1
0
        public bool Save(Model model)
        {
            var base64Code = ConvertBase64(model.CodeText, Converts.Convert);
            var address = ConvertBase64(model.CodeName, Converts.Convert);

            var w = new StreamWriter(PathAddress, true);
            w.WriteLine(model.CodeCreateTime + " " + address + " " + base64Code);
            w.Close();
            return true;
        }
Beispiel #2
0
        //将所有的bug存储下来
        public static void Save(string[] code)
        {
            var c = new DataController();
            var m = new Model();
            if (code.Length > 2)
            {
                DataController.PathAddress = code[2];
            }

            if (code.Length > 1)
            {
                m.CodeName = code[1];
            }
            m.CodeText = code[0];
            c.Save(m);
            Console.WriteLine("OK");
        }
Beispiel #3
0
        public static List<Model> GetCode()
        {
            var arrayList = DataController.GetAllCode();
            var list = new List<Model>();

            foreach (var item in arrayList)
            {
                if (item.Length < 4) continue;
                var m = new Model();
                var thisItem = item.Split(' ');
                var date = thisItem[0] + " " + thisItem[1];
                m.CodeCreateTime = Convert.ToDateTime(date);
                m.CodeName = DataController.ConvertBase64(thisItem[2], DataController.Converts.ReConvert);
                m.CodeText = DataController.ConvertBase64(thisItem[3], DataController.Converts.ReConvert);
                list.Add(m);
            }
            return list;
        }