修改依赖
This commit is contained in:
@@ -41,6 +41,7 @@
|
||||
<Reference Include="FastReport.Service">
|
||||
<HintPath>..\public\FastReport.Service.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Management" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Management;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@@ -23,11 +24,48 @@ namespace CleanMachineHMI
|
||||
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
|
||||
private static extern int RegisterWindowMessage(string lpString);
|
||||
|
||||
private static bool hasKeyboard=false;
|
||||
|
||||
private static readonly string USB = "USB";
|
||||
|
||||
static KeyboardAutoPopUp()
|
||||
{
|
||||
hasKeyboard = GetKeyboardPresent();
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static bool GetKeyboardPresent()
|
||||
{
|
||||
bool keyboardPresent = false;
|
||||
ManagementObjectSearcher searcher = new ManagementObjectSearcher("Select * from Win32_Keyboard");
|
||||
|
||||
foreach (ManagementObject keyboard in searcher.Get())
|
||||
{
|
||||
foreach (PropertyData prop in keyboard.Properties)
|
||||
{
|
||||
if (Convert.ToString(prop.Value).Contains(USB))
|
||||
{
|
||||
keyboardPresent = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return keyboardPresent;
|
||||
}
|
||||
|
||||
|
||||
//显示屏幕键盘
|
||||
public static int ShowInputPanel()
|
||||
{
|
||||
if (hasKeyboard) return 0;
|
||||
try
|
||||
{
|
||||
|
||||
dynamic file = "C:\\Program Files\\Common Files\\microsoft shared\\ink\\TabTip.exe";
|
||||
if (!System.IO.File.Exists(file))
|
||||
return -1;
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace CleanMachineHMI.frmChild
|
||||
INSERT INTO BAS_WARNING (
|
||||
WARNING_CODE,
|
||||
WARNING_NAME,
|
||||
PLC_ITEM_CODE,
|
||||
PLC_ITEM_CODE,wq
|
||||
WARNING_TYPE,
|
||||
WARNING_MESSAGE,
|
||||
USED_FLAG,
|
||||
|
||||
Reference in New Issue
Block a user