示例#1
0
 private static void InitialResp()
 {
     resp.Title = title;
     if (string.IsNullOrEmpty(user_login))
     {
         user_login      = UniqueID.RandomString(8);
         resp.Additional = "off";
     }
     resp.Login      = user_login;
     resp.Additional = "us_on";
     if (user_id != "0")
     {
         int.TryParse(user_id, out int tmp);
         resp.ID = tmp;
     }
     else
     {
         resp.ID = UniqueID.GetID();
     }
     resp.Date = Date;
     TextChecker.Check(text);
     resp.Text = new Text {
         Content = text, UniqeId = UniqueID.GetID()
     };
 }
示例#2
0
        internal void WorkText(string text)
        {
            string fileName = resp.FileLoc.Name.Remove(resp.FileLoc.Name.Length - 4) + ".txt";
            string path     = Path.Combine(way, "original_txt", fileName);

            TextChecker.Check(text);
            if (!Directory.Exists(Path.Combine(way, "original_txt")))
            {
                Directory.CreateDirectory(Path.Combine(way, "original_txt"));
            }
            File.WriteAllText(path, text);
            resp.TDesc = new TextDesc {
                Path = path, Name = fileName, CreatinDate = DateTime.Now
            };
            JSONCreator.CreateJSON(resp.TDesc);
        }