首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

C# 启动 非 exe 程序解决思路

2012-01-08 
C# 启动 非 exe 程序如何用C#启动一个TMP或者其他后缀名的程序呢?[解决办法]Invoke API CreateProcess只要

C# 启动 非 exe 程序
如何用   C#   启动一个   TMP   或者其他后缀名的程序呢?

[解决办法]
Invoke API CreateProcess
只要是exe文件 不管后缀名是什么都ok
[解决办法]
using System.Runtime.InteropServices;

[DllImport( "kernel32.dll ")]
internal static extern uint WinExec(string lpCmdLine, uint uCmdShow);
private const uint SW_SHOW = 5;

private void button1_Click(object sender, EventArgs e)
{
WinExec(@ "c:\temp\temp.tmp ", SW_SHOW);
}

热点排行