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#
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#
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();
}
}
{
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();
}
}
if (System.Environment.OSVersion.ToString().IndexOf("NT 5"))
{
myProcess.Start("msiexec", "/X{2B65D4A9-C146-4808-AB4B-321FB0779559}");
}
myProcess.Close();
我是想自己写个卸载的控制台程序,打包到我的项目里面。
但是我在网上找到的是上面那段代码,哪位大哥帮我写一个好吗
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(); }
}
}