NewLife/X

嵌入清单文件后,正确识别win10
大石头 authored at 2019-12-08 22:27:23
e14e197
Tree
1 Parent(s) 1f7a1b9
Summary: 3 changed files with 12 additions and 10 deletions.
Modified +6 -6
Modified +4 -3
Modified +2 -1
Modified +6 -6
diff --git a/Test/app.manifest b/Test/app.manifest
index b13936c..969c646 100644
--- a/Test/app.manifest
+++ b/Test/app.manifest
@@ -15,7 +15,7 @@
             如果你的应用程序需要此虚拟化来实现向后兼容性,则删除此
             元素。
         -->
-        <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
+        <!--<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />-->
       </requestedPrivileges>
     </security>
   </trustInfo>
@@ -27,19 +27,19 @@
            自动选择最兼容的环境。 -->
 
       <!-- Windows Vista -->
-      <!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
+      <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />
 
       <!-- Windows 7 -->
-      <!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
+      <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
 
       <!-- Windows 8 -->
-      <!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
+      <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
 
       <!-- Windows 8.1 -->
-      <!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
+      <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
 
       <!-- Windows 10 -->
-      <!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
+      <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
 
     </application>
   </compatibility>
Modified +4 -3
diff --git a/Test/Program.cs b/Test/Program.cs
index b404750..565de6a 100644
--- a/Test/Program.cs
+++ b/Test/Program.cs
@@ -46,7 +46,7 @@ namespace Test
                 try
                 {
 #endif
-                    Test4();
+                    Test1();
 #if !DEBUG
                 }
                 catch (Exception ex)
@@ -68,13 +68,14 @@ namespace Test
         static void Test1()
         {
             var ip = "180.165.235.0".IPToAddress();
-            Console.WriteLine(ip);
+            XTrace.WriteLine(ip);
 
             var mi = new MachineInfo();
+            mi.Init();
 
             foreach (var pi in mi.GetType().GetProperties())
             {
-                Console.WriteLine("{0}:\t{1}", pi.Name, mi.GetValue(pi));
+                XTrace.WriteLine("{0}:\t{1}", pi.Name, mi.GetValue(pi));
             }
 
             Console.ReadKey();
Modified +2 -1
diff --git a/Test/Test.csproj b/Test/Test.csproj
index bf6e5f5..ffb620b 100644
--- a/Test/Test.csproj
+++ b/Test/Test.csproj
@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk" ToolsVersion="Current">
   <PropertyGroup>
     <OutputType>Exe</OutputType>
-    <TargetFrameworks>net45</TargetFrameworks>
+    <TargetFrameworks>net45;netcoreapp3.1</TargetFrameworks>
     <OutputPath>..\..\Test\</OutputPath>
     <LangVersion>latest</LangVersion>
     <Version>1.0.0.1130</Version>
@@ -11,6 +11,7 @@
     <DebugType>pdbonly</DebugType>
     <Optimize>true</Optimize>
     <DefineConstants>TRACE</DefineConstants>
+    <ApplicationManifest>app.manifest</ApplicationManifest>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)'=='Debug'">
     <DefineConstants>$(DefineConstants);DEBUG</DefineConstants>