VB.NET 强制删除文件

Private Sub KillProcess(ByVal processName As String) ' 杀进程代码
         Dim myproc As System.Diagnostics.Process = New System.Diagnostics.Process
         Try
             For Each thisproc As Process In Process.GetProcessesByName(processName)
                 If (Not thisproc.CloseMainWindow()) Then
                     thisproc.Kill()
                 End If
             Next
         Catch
         End Try
     End Sub

猜你喜欢

转载自blog.csdn.net/polloo2012/article/details/79431085