1.my code kill process
foreach (Process s1 in Process.GetProcessesByName("test"))
{
s1.Kill();
}
2.我的代码检查说明
FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo(@"C:\test\test.exe");
label1.Text = ""+ ("File: " + myFileVersionInfo.FileDescription);
答案 0 :(得分:0)
VB.NET
Dim FileDes As String = String.Empty '//FileDescription
For Each x As Process In Process.GetProcesses
If FileDes = x.MainModule.FileVersionInfo.FileDescription Then
x.Kill()
End If
Next
C#
string FileDes = string.Empty; //FileDescription
foreach (Process x in Process.GetProcesses) {
if (FileDes == x.MainModule.FileVersionInfo.FileDescription) {
x.Kill();
}
}