C#怎样调用VC编写的可执行程序(*.exe)?
解决方案 »
- 怎么写软件变动需求
- 返回dataGridView行数
- C#的一个很简单的问题。。请高手帮忙。小弟无尽感激//
- 请教大师们,listbox 点击节点后,选中的值在另一个txt中出现应该怎么搞
- 如何实现windowsform框架
- 询问一个关于异步socket编程的问题,主要是关于waitone()函数的问题
- 20分,20分,也是分啊,请高手给扒一下一个网站的JS代码{有扒了一天也不行}
- !!!怎么将一个窗体的Button (用传参的方法)传到另一个窗体上用
- 在c#中如何读取excel中的数据
- 问大家一下, 以前学的 window编程 对学习 . net framework 有没有帮助?
- 如何给页面的label1标签添加单击事件?
- C#中两个Form间的调用问题。
using System.Diagnostics;
using System.ComponentModel;namespace MyProcessSample
{
/// <summary>
/// Shell for the sample.
/// </summary>
class MyProcess
{
/// <summary>
/// Opens the Internet Explorer application.
/// </summary>
void OpenApplication(string myFavoritesPath)
{
// Start Internet Explorer. Defaults to the home page.
Process.Start("IExplore.exe");
// Display the contents of the favorites folder in the browser.
Process.Start(myFavoritesPath);
}
/// <summary>
/// Opens urls and .html documents using Internet Explorer.
/// </summary>
void OpenWithArguments()
{
// url's are not considered documents. They can only be opened
// by passing them as arguments.
Process.Start("IExplore.exe", "www.northwindtraders.com");
// Start a Web page using a browser associated with .html and .asp files.
Process.Start("IExplore.exe", "C:\\myPath\\myFile.htm");
Process.Start("IExplore.exe", "C:\\myPath\\myFile.asp");
}
/// <summary>
/// Uses the ProcessStartInfo class to start new processes, both in a minimized
/// mode.
/// </summary>
void OpenWithStartInfo()
{
ProcessStartInfo startInfo = new ProcessStartInfo("IExplore.exe");
startInfo.WindowStyle = ProcessWindowStyle.Minimized;
Process.Start(startInfo);
startInfo.Arguments = "www.northwindtraders.com";
Process.Start(startInfo);
} static void Main()
{
// Get the path that stores favorite links.
string myFavoritesPath =
Environment.GetFolderPath(Environment.SpecialFolder.Favorites);
MyProcess myProcess = new MyProcess();
myProcess.OpenApplication(myFavoritesPath);
myProcess.OpenWithArguments();
myProcess.OpenWithStartInfo(); }
}
}