如果不是000,则匹配unins000.exe

时间:2012-01-31 10:06:47

标签: c# regex filenames

我正在使用Inno Setup为我的应用程序创建一个简单的设置,A。 从第二个应用程序B,我想调用应用程序A的unins000.exe

所以我只使用这段代码,而且效果很好:

  //get a new process to start
ProcessStartInfo startInfo = new ProcessStartInfo();
  //get the basic exe file to run (the uninstall)
startInfo.FileName = installPathA() + "\\unins000.exe";
  //start the uninstall
Process p = new Process();
p.StartInfo = startInfo;
p.Start();

但在这种情况下,我已将其硬编码为000中的unins000.exe

我想知道的是,unins...exe可能会自动检查...上应该有哪些数字。

我一开始认为使用RegEx,但这只能用于定义的字符串吗?或者我也可以这样使用它吗? 或者有人知道更好的伎俩吗?

1 个答案:

答案 0 :(得分:0)

http://msdn.microsoft.com/en-us/library/8he88b63.aspx

DirectoryInfo.GetFiles()采用一种模式,允许您搜索匹配。