Module  uninstall 
          Sub  Main() 
                  Dim  myProcess  As  Process  =  New  Process 
                  If  System.Environment.OSVersion.ToString.IndexOf("NT  5")  Then 
                          myProcess.Start("msiexec",  "/X{2B65D4A9-C146-4808-AB4B-321FB0779559}")     
                  End  If 
                  myProcess.Close() 
          End  Sub 
End  Module 
帮忙把这段代码翻译成C#

解决方案 »

  1.   


    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Diagnostics;namespace Msiexec
    {
        class Program
        {
            static void Main(string[] args)
            {
                Process myProcess = new Process();
                myProcess.Start("msiexec", "/X{8B3B80C4-FCDC-4C86-9E11-1B1513DFC087}");
                myProcess.Close();
            }
        }
      

  2.   

    static class uninstall 

        public static void Main() 
        { 
            Process myProcess = new Process(); 
            if (System.Environment.OSVersion.ToString.IndexOf("NT 5")) { 
                myProcess.Start("msiexec", "/X{2B65D4A9-C146-4808-AB4B-321FB0779559}"); 
            } 
            myProcess.Close(); 
        } 
      

  3.   

                Process myProcess = new Process();
                if (System.Environment.OSVersion.ToString().IndexOf("NT 5"))
                {
                    myProcess.Start("msiexec", "/X{2B65D4A9-C146-4808-AB4B-321FB0779559}");
                }
                myProcess.Close();
      

  4.   

    错误 1 无法使用实例引用访问静态成员“System.Diagnostics.Process.Start(string, string)”;改用类型名来限定它
    我是想自己写个卸载的控制台程序,打包到我的项目里面。
    但是我在网上找到的是上面那段代码,哪位大哥帮我写一个好吗
      

  5.   

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using System.Diagnostics;namespace WindowsApplication1
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }        private void button1_Click(object sender, EventArgs e)
            {
                this.Visible = false;
                Process myProcess = new Process();            Process.Start("msiexec", "/X{2B65D4A9-C146-4808-AB4B-321FB0779559}");            myProcess.Close();
                this.Close();        }
        }
    }