You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lj_plc/Actions/Default/Mesnac.Action.Default/Tools/CalCalculatorAction.cs

30 lines
925 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mesnac.Action.Base;
namespace Mesnac.Action.Default.Tools
{
/// <summary>
/// 调用系统计算器类
/// </summary>
public class CalCalculatorAction : DatabaseAction, IAction
{
public void Run(RuntimeParameter runtime)
{
base.RunIni(runtime);
try
{
System.Diagnostics.ProcessStartInfo Info = new System.Diagnostics.ProcessStartInfo();
Info.FileName = "calc.exe ";//"calc.exe"为计算器,"notepad.exe"为记事本
System.Diagnostics.Process Proc = System.Diagnostics.Process.Start(Info);
}
catch (Exception ex)
{
ICSharpCode.Core.LoggingService<CalCalculatorAction>.Error("调用系统计算器失败:" + ex.Message);
}
}
}
}