using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HighWayIot.Common
{
public class OSKHelper
{
#region 打开软盘
///
/// 打开软盘
///
public static void OpenOsk()
{
try
{
Process proc = new Process();
proc.StartInfo.FileName = @"C:\Windows\System32\osk.exe";
proc.StartInfo.UseShellExecute = true;
proc.StartInfo.Verb = "runas";
proc.Start();
}
catch
{
}
}
#endregion
#region 关闭软盘
///
/// 关闭软盘
///
public static void CloseOsk()
{
try
{
// 查找并关闭 osk.exe 进程
foreach (Process proc in Process.GetProcessesByName("osk"))
{
proc.Kill();
}
}
catch
{
// 可以在这里处理异常情况
}
}
#endregion
}
}