private void OnEnumNote() { List <int> notelist = null; if (NotebookApi.NotebookList(NotebookId, NotebookPass, ref notelist)) { NoteList = notelist; Console.WriteLine("Id为{0}的Notebook中 有如下Note", NotebookId); foreach (var obj in NoteList) { Console.WriteLine("Id : {0}", obj); Tuple <int, string, string> note = null; if (NoteApi.NoteGet(NotebookId, NotebookPass, obj, ref note)) { Console.WriteLine("Type : {0}", note.Item1); Console.WriteLine("Name : {0}", note.Item2); Console.WriteLine("Data : {0}", note.Item3); } else { Console.WriteLine("获取失败"); } } } else { Console.WriteLine("获取数据失败"); } Console.ReadKey(); }
private void OnEnumNotebook() { List <int> notebooklist = null; if (UserApi.UserNotebook(Username, Password, ref notebooklist)) { NotebookList = notebooklist; Console.WriteLine("您的Notebook有:"); Tuple <string, int> result = null; foreach (var obj in NotebookList) { Console.WriteLine("Id : {0}", obj); if (NotebookApi.NotebookGet(obj, ref result)) { Console.WriteLine("Name : {0}", result.Item1); Console.WriteLine("NoteSum : {0}", result.Item2); } } } else { Console.WriteLine("获取信息失败"); } Console.ReadKey(); }
private void TestDate() { Console.WriteLine("before create notebook"); int uid = 0; UserApi.UserCreate("kingwl", "123456", ref uid); List <int> list = null; if (UserApi.UserNotebook("kingwl", "123456", ref list)) { Console.WriteLine("user notebook list : "); foreach (var obj in list) { Console.WriteLine(obj); } } Console.WriteLine("after create notebook"); int noteid = 0; NotebookApi.NotebookCreate("kingwl", "123456", "test", "654321", ref noteid); if (UserApi.UserNotebook("kingwl", "123456", ref list)) { Console.WriteLine("user notebook list : "); foreach (var obj in list) { Console.WriteLine(obj); } } Console.WriteLine("after delete notebook"); NotebookApi.NotebookDelete(noteid, "654321"); if (UserApi.UserNotebook("kingwl", "123456", ref list)) { Console.WriteLine("user notebook list : "); foreach (var obj in list) { Console.WriteLine(obj); } } Console.WriteLine("hello world!"); Console.ReadKey(); }
private void OnEnterPass() { Console.WriteLine("请输入Notebook密码"); string pass = Console.ReadLine(); List <int> Notes = null; if (NotebookApi.NotebookList(Id, pass, ref Notes)) { SceneManager.Instance.PushScene(new NotebookScene(Username, Password, Id, pass)); Console.WriteLine("密码正确 按下任意按键转入Notebook页面"); } else { Console.WriteLine("密码错误"); } Console.ReadKey(); }
private void OnCreateNotebook() { Console.WriteLine("输入NotebookName"); string notebookname = Console.ReadLine(); Console.WriteLine("输入NotebookPass"); string notebookpass = Console.ReadLine(); int notebookid = 0; if (NotebookApi.NotebookCreate(Username, Password, notebookname, notebookpass, ref notebookid)) { Console.WriteLine("创建成功"); } else { Console.WriteLine("创建失败"); } Console.ReadKey(); }
private void OnDeleteNotebook() { Console.WriteLine("输入要删除的Notebook的ID"); int id = 0; if (int.TryParse(Console.ReadLine().Trim(), out id)) { Console.WriteLine("输入要删除的Notebook的密码"); string pass = Console.ReadLine(); if (NotebookApi.NotebookDelete(id, pass)) { Console.WriteLine("删除成功"); } else { Console.WriteLine("密码错误"); } } else { Console.WriteLine("输入错误"); } Console.ReadKey(); }