1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
''' <summary>
''' Der Wert muss als Integer uebergeben werden, damit
''' in der Registrey auch ein REG_DWORD geschrieben
''' wird
''' </summary>
''' <param name="YesOrNo"></param>
''' <returns></returns>
''' <remarks></remarks>
Function DisableFirewallNotification(ByVal YesOrNo As Integer) As Boolean
Try
Select Case YesOrNo
Case Is = 1
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Security Center", "FirewallDisableNotify", YesOrNo)
MessageBox.Show("... completed successfully" & vbCrLf & "Please reboot system.", _
"Reg. Manipulation ...", MessageBoxButtons.OK, MessageBoxIcon.Information)
Case Is = 0
Try
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Security Center", "FirewallDisableNotify", YesOrNo)
MessageBox.Show("... completed successfully" & vbCrLf & "Please reboot system.", _
"Reg. Manipulation ...", MessageBoxButtons.OK, MessageBoxIcon.Information)
Catch ex As Exception
MessageBox.Show(ex.Message, "Reg. Manipulation failed", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Select
Catch ex As Exception
MessageBox.Show(ex.Message, "Reg. Manipulation failed", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Function
'Aufruf und Überbage der Parameter
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim YesOrNo As Integer = InputBox("Bitte geben Sie an, ob das Monitoring der Firewall aktiv sein soll." & _
vbCrLf & "0 = AKTIV" & vbCrLf & "1 = NICHT AKTIV", "Firewall-Monitoring", _
"0")
DisableFirewallNotification(YesOrNo)
End Sub
|