VB.NET 中的SHELL函数 在C#中类似的函数是什么?

来源:百度知道 编辑:UC知道 时间:2024/06/19 00:47:21

同样功能的是这个: System.Diagnostics.Process.Start();

下面是例子,或许对你有用:

using System;
using System.Diagnostics;
using System.ComponentModel;

namespace MyProcessSample
{
/// <summary>
/// Shell for the sample.
/// </summary>
public class MyProcess
{
// These are the Win32 error code for file not found or access denied.
const int ERROR_FILE_NOT_FOUND =2;
const int ERROR_ACCESS_DENIED = 5;

/// <summary>
/// Prints a file with a .doc extension.
/// </summary>
public void PrintDoc()
{