一定要在项目中添加引用Microsoft.CSharp 这里是打开写字板程序 using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Runtime.InteropServices.Automation; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; namespace InvokeNotepad { public partial class MainPage : UserControl { public MainPage() { InitializeComponent(); } private void button1_Click(object sender, RoutedEventArgs e) { if (App.Current.HasElevatedPermissions) { using (dynamic cmd = AutomationFactory.CreateObject("WScript.Shell")) { cmd.Run(@"C:/WINDOWS/NOTEPAD.EXE", 1, true); } } } } }