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 { } }
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);