C# 在C中使用System.Diagnostic.Process及其卸载字符串卸载程序#

C# 在C中使用System.Diagnostic.Process及其卸载字符串卸载程序#,c#,registry,uninstallation,uninstallstring,C#,Registry,Uninstallation,Uninstallstring,我正在使用注册表中的卸载字符串卸载程序,但是第一个链接的代码中有一些错误。 我试图修复它,但我很难弄清楚文件名中会有什么,参数中会有什么。我的字符串是: rundll32.exe dfshim.dll,sharpMaintent ItemMan.Client.application,区域性=中性,PublicKeyToken=4f1069eb693dc232,processorArchitecture=msil 注册表中的目录为 CurrentUser\SOFTWARE\Microsoft\Wi

我正在使用注册表中的卸载字符串卸载程序,但是第一个链接的代码中有一些错误。 我试图修复它,但我很难弄清楚文件名中会有什么,参数中会有什么。我的字符串是:

rundll32.exe dfshim.dll,sharpMaintent ItemMan.Client.application,区域性=中性,PublicKeyToken=4f1069eb693dc232,processorArchitecture=msil

注册表中的目录为

CurrentUser\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\9e648bbdf5bc3053

我遇到问题的部分是:

            System.Diagnostics.Process FProcess = new System.Diagnostics.Process();
            FProcess.StartInfo.FileName = "rundll32.exe"; (Dont know if this is right though, but have tried various ways to write the FileName...)
            FProcess.StartInfo.Arguments = "9e648bbdf5bc3053";
            FProcess.StartInfo.UseShellExecute = false;
            FProcess.Start();
            FProcess.WaitForExit();

有了这一点,什么也不会发生。我试过的所有其他方法都会出错。您将如何剪切/使用未安装的字符串来卸载该程序

卸载字符串是全部内容,第一个可执行文件之后的所有内容都是参数,因此您需要执行以下操作:

var start_info = new StartInfo() {
    FileName = "rundll32.exe",
    Arguments = "dfshim.dll,ShArpMaintain ItemMan.Client.application, Culture=neutral, PublicKeyToken=4f1069eb693dc232, processorArchitecture=msil",
    UseShellExecute = false
};

Process process = new Process(start_info);

process.Start();
process.WaitForExit();