我想用进程类打开 windows 便签,我已经知道如何为计算器和绘画执行此操作,但不知道便签。当我给它提供便利贴地址时,它打不开。我使用 64 位 Windows。 (窗体)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace main
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("mspaint");
System.Diagnostics.Process.Start("calc");
//sticky notes
System.Diagnostics.Process.Start("C:\\Windows\\System32\\StikyNot.exe");
}
}
}
它给出了找不到文件的异常,但它存在于该位置。
请您参考如下方法:
您必须从 C:\Windows\Sysnative\StikyNot.exe 打开文件:
System.Diagnostics.Process.Start(@"C:\Windows\Sysnative\StikyNot.exe");
由于x64系统上System32文件夹是合成的,直接调用是不行的。您必须使用 Sysnative 名称将路径映射到“真实”system32 文件夹。
