2014-03-03 2 views

답변

4

ManagementObjectSearcher를 사용하여이 정보를 얻을 수 있습니다.

Public Function GetAntivirus() As String 
    Try 
     Dim data As String = String.Empty 
     For Each firewall As ManagementObject In New ManagementObjectSearcher("root\SecurityCenter" & IIf(My.Computer.Info.OSFullName.Contains("XP"), "", "2").ToString, "SELECT * FROM AntiVirusProduct").Get 
      data &= firewall("displayName").ToString 
     Next 
     If Not data = String.Empty Then 
      Return data 
     Else 
      Return "No Antivirus" 
     End If 

    Catch 
     Return "No Antivirus" 
    End Try 

End Function 

Public Function GetFirewall() As String 
    Try 

      Dim data As String = String.Empty 
      For Each firewall As ManagementObject In New ManagementObjectSearcher("root\SecurityCenter" & IIf(My.Computer.Info.OSFullName.Contains("XP"), "", "2").ToString, "SELECT * FROM FirewallProduct").Get 
       Data &= firewall("displayName").ToString 
      Next 
     If Not data = String.Empty Then 
      Return data 
     Else 
      Return "No Firewall" 
     End If 
     Catch 
      Return "No Firewall" 
     End Try 

End Function 
관련 문제