From ee4854787e91002e89a3b3e171c826826ec869f5 Mon Sep 17 00:00:00 2001 From: falcon <9504402@qq.com> Date: Thu, 16 Feb 2023 18:12:17 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8B=AC=E7=AB=8BWindows=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Falcon.SugarApi.WebService.csproj | 5 ++++ .../Falcon.SugarApi.Windows.csproj | 14 +++++++++ .../README.md | 0 .../System.cs | 29 +++++++++---------- Falcon.SugarApi.sln | 6 ++++ 5 files changed, 38 insertions(+), 16 deletions(-) create mode 100644 Falcon.SugarApi.Windows/Falcon.SugarApi.Windows.csproj rename {Falcon.SugarApi/WindowsSystem => Falcon.SugarApi.Windows}/README.md (100%) rename Falcon.SugarApi/WindowsSystem/WindowsSystemTime.cs => Falcon.SugarApi.Windows/System.cs (63%) diff --git a/Falcon.SugarApi.WebService/Falcon.SugarApi.WebService.csproj b/Falcon.SugarApi.WebService/Falcon.SugarApi.WebService.csproj index 0e981d0..4ea9d01 100644 --- a/Falcon.SugarApi.WebService/Falcon.SugarApi.WebService.csproj +++ b/Falcon.SugarApi.WebService/Falcon.SugarApi.WebService.csproj @@ -4,6 +4,11 @@ net6.0 enable enable + WebService相关方法 + bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml + true + true + 1.0.0 diff --git a/Falcon.SugarApi.Windows/Falcon.SugarApi.Windows.csproj b/Falcon.SugarApi.Windows/Falcon.SugarApi.Windows.csproj new file mode 100644 index 0000000..d2595ba --- /dev/null +++ b/Falcon.SugarApi.Windows/Falcon.SugarApi.Windows.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + Windows系统相关方法 + bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml + true + true + 1.0.0 + + + diff --git a/Falcon.SugarApi/WindowsSystem/README.md b/Falcon.SugarApi.Windows/README.md similarity index 100% rename from Falcon.SugarApi/WindowsSystem/README.md rename to Falcon.SugarApi.Windows/README.md diff --git a/Falcon.SugarApi/WindowsSystem/WindowsSystemTime.cs b/Falcon.SugarApi.Windows/System.cs similarity index 63% rename from Falcon.SugarApi/WindowsSystem/WindowsSystemTime.cs rename to Falcon.SugarApi.Windows/System.cs index 51bb7f6..30346c2 100644 --- a/Falcon.SugarApi/WindowsSystem/WindowsSystemTime.cs +++ b/Falcon.SugarApi.Windows/System.cs @@ -1,12 +1,8 @@ -using System; -using System.Runtime.InteropServices; +using System.Runtime.InteropServices; -namespace Falcon.SugarApi.WindowsSystem +namespace Falcon.SugarApi.Windows { - /// - /// Windows系统时间 - /// - public static class WindowsSystemTime + public partial class System { [StructLayout(LayoutKind.Sequential)] private struct Systemtime @@ -31,16 +27,17 @@ namespace Falcon.SugarApi.WindowsSystem /// 返回系统时间设置状态,true为成功,false为失败 public static bool SetLocalDateTime(DateTime dt) { Systemtime st; - st.year = (short)dt.Year; - st.month = (short)dt.Month; - st.dayOfWeek = (short)dt.DayOfWeek; - st.day = (short)dt.Day; - st.hour = (short)dt.Hour; - st.minute = (short)dt.Minute; - st.second = (short)dt.Second; - st.milliseconds = (short)dt.Millisecond; + st.year=(short)dt.Year; + st.month=(short)dt.Month; + st.dayOfWeek=(short)dt.DayOfWeek; + st.day=(short)dt.Day; + st.hour=(short)dt.Hour; + st.minute=(short)dt.Minute; + st.second=(short)dt.Second; + st.milliseconds=(short)dt.Millisecond; bool rt = SetLocalTime(ref st); return rt; } + } -} +} \ No newline at end of file diff --git a/Falcon.SugarApi.sln b/Falcon.SugarApi.sln index b2e30e7..5024744 100644 --- a/Falcon.SugarApi.sln +++ b/Falcon.SugarApi.sln @@ -15,6 +15,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Falcon.SugarApi.WebService", "Falcon.SugarApi.WebService\Falcon.SugarApi.WebService.csproj", "{A02586C2-B485-47C3-988B-AC050BD2286C}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Falcon.SugarApi.Windows", "Falcon.SugarApi.Windows\Falcon.SugarApi.Windows.csproj", "{68AF37DA-5B3E-4ADF-9054-CE5F42667625}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -33,6 +35,10 @@ Global {A02586C2-B485-47C3-988B-AC050BD2286C}.Debug|Any CPU.Build.0 = Debug|Any CPU {A02586C2-B485-47C3-988B-AC050BD2286C}.Release|Any CPU.ActiveCfg = Release|Any CPU {A02586C2-B485-47C3-988B-AC050BD2286C}.Release|Any CPU.Build.0 = Release|Any CPU + {68AF37DA-5B3E-4ADF-9054-CE5F42667625}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {68AF37DA-5B3E-4ADF-9054-CE5F42667625}.Debug|Any CPU.Build.0 = Debug|Any CPU + {68AF37DA-5B3E-4ADF-9054-CE5F42667625}.Release|Any CPU.ActiveCfg = Release|Any CPU + {68AF37DA-5B3E-4ADF-9054-CE5F42667625}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE