可以将文件复制到system32中,运行输入指定命令就可以直接打开。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Calc
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
int cursorPosition = 0;
private void richTextBox1_KeyPress(object sender, KeyPressEventArgs e)
{
cursorPosition = richTextBox1.SelectionStart;
//如果输入的不是数字键,也不是回车键、Backspace键,则取消该输入
if ((Char.IsNumber(e.KeyChar)))//&& e.KeyChar != (char)13 && e.KeyChar != (char)8)
{
e.Handled = false;
}
else if (e.KeyChar == (char)46)
{
string ricstr = richTextBox1.Text;
string[] ricstrs = ricstr.Split('+', '-', '*', '/');
string ricTail = ricstrs[ricstrs.Length - 1];
if (ricTail.Contains('.'))
{
e.Handled = t