您好,欢迎光临本网站![请登录][注册会员]  
文件名称: C#调用记事本计算机
  所属分类: C
  开发工具:
  文件大小: 2kb
  下载次数: 1
  上传时间: 2009-07-15
  提 供 者: luoxu*****
 详细说明: 直接调用外部命令就可以了,给你写了四个! System.Diagnostics.Process.Start("notepad.exe");//记事本 System.Diagnostics.Process.Start("winword.exe");//Word System.Diagnostics.Process.Start("excel.exe");//Excel System.Diagnostics.Process.Start("calc .exe");//计算器 在单击事件里直接加入就可以了! 在C#中如何调用记事本 using System.Diagnostics; Process.Start(path+"notepad.exe"); 如果用xp,你可以 using System.Diagnostics; Process.Start("c:\windows\system32\notepad.exe"); 打开其它应用程序同理。 C#中如何调用系统计算器和记事本 (2008-08-11 09:32:02) 标签:c 调用 it 分类:C# System.Diagnostics.ProcessStartInfo Info = new System.Diagnostics.ProcessStartInfo(); //设置外部程序名(记事本) Info.FileName="notepad.exe"; //设置外部程序的启动参数 Info.Arguments=""; //设置外部程序工作目录为c:\windows Info.WorkingDirectory="c:/windows/"; //声明一个程序类 System.Diagnostics.ProcessProc; try { // //启动外部程序 // Proc=System.Diagnostics.Process.Start(Info); } catch { MessageBox.Show("系统找不到指定的程序文件","错误提示!"); return; } 其他的类似,直接调用外部命令就可以了 System.Diagnostics.Process.Start("notepad.exe");//记事本 System.Diagnostics.Process.Start("winword.exe");//Word System.Diagnostics.Process.Start("excel.exe");//Excel System.Diagnostics.Process.Start("calc.exe");//计算器 在单击事件里直接加入就可以了!参数也可以是文件路径 提供两种实现方法 1、 System.Diagnostics.ProcessStartInfo Process= new System.Diagnostics.ProcessStartInfo(); //设置要调用的外部程序名 Info.FileName = "notepad.exe"; //设置外部程序的启动参数(命令行参数)为1.txt Info.Arguments = "1.txt"; //设置外部程序工作目录为 C:\ Info.WorkingDirectory = "C:\\"; Process.Start(); 2、 第一步,申明要调用的系统的API [DllImport("shell32.dll")] public static extern int ShellExecute(IntPtr hwnd,StringBuilder lpszOp,StringBuilder lpszFile,StringBuilder lpszParams,StringBuilder lpszDir,int FsShowCmd); //放在方法外面,方法的申明 调用 ShellExecute(IntPtr.Zero,new StringBuilder("Open"),new StringBuilder("notepad"),new StringBuilder(""),new StringBuilder(@"C:"), 1); 还有要导入命名空间:using System.Runtime.InteropServices; ...展开收缩
(系统自动生成,下载前可以参看下载内容)

下载文件列表

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
 相关搜索: 计算机 记事本 Word Excel
 输入关键字,在本站1000多万海量源码库中尽情搜索: