![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C#
王成天
这个作者很懒,什么都没留下…
展开
-
SqlServer DateTimeOffest 毫秒会四舍五入
当SqlServer中columnType设置为datetimeoffset(0)时,毫秒会四舍五入// 当 sql server 中 columnType设置为datetimeoffset(0)时var date1 = new DateTimeOffset(2022, 04, 08, 00, 00, 00, 500, TimeSpan.Zero);// 保存到sql servre后,为"2022-04-08 00:00:01 +00:00"var date2 = new DateTimeO原创 2022-04-08 15:39:15 · 1092 阅读 · 0 评论 -
C# 把子对象赋值给父对象(互相赋值)
// Modelpublic class ParentClass{ ...}public class ChildClass : ParentClass{ ...}// Utilitypublic static O AutoCopy<O, I>(I input) where O : new(){ var output = new O(); var InputType = typeof(I); var InputTypeProps..原创 2020-05-25 17:46:18 · 1929 阅读 · 0 评论 -
C# 把一个文件夹下所有文件复制到另一个文件夹下
C# 把一个文件夹下所有文件复制到另一个文件夹下public static void CopyDirectory(string srcPath, string destPath){ try { DirectoryInfo dir = new DirectoryInfo(srcPath); FileSystemInfo[] fileinfo = dir.Get...转载 2019-01-16 19:45:50 · 3434 阅读 · 0 评论