Пример #1
0
        public void Write(string str)
        {
            try
            {
                lock (LockObj)
                {
                    DateTime now    = DateTime.Now;
                    string   nowStr = Str.DateTimeToDtstr(now, true);

                    string tmp = nowStr + "," + str + "\r\n";

                    write(now, Str.Utf8Encoding.GetBytes(tmp), Flush);
                }
            }
            catch
            {
            }
        }
Пример #2
0
 public static string ToDtStr(this DateTimeOffset dt, bool with_msecs = false, DtstrOption option = DtstrOption.All, bool with_nanosecs = false) => Str.DateTimeToDtstr(dt, with_msecs, option, with_nanosecs);