|
WMI Fun !! 〜 WMIに興味がある方・システム管理者必見!! 〜 WMI StepWMI SampleWMI ReferenceWMI LibraryPersonalLinkAbout WMI Fun !! |
|
|
|
WMI Fun !! > WMI Sample (VB) > WindowsファイアウォールのICMP設定を取得する |
|
|
Panasonic Let'snoteを長年愛用しています、その理由はMy Let'snoteで…
インクを買うよりもしかしたら安い?インクジェット複合機HP Photosmart 5510 白いご飯や日本酒にもとても合うにしんのきりこみがマイブームです WindowsファイアウォールのICMP設定を取得する: HNet_FwIcmpSettings - WMI Sample (VB)Topics
現在のWindowsファイアウォールのICMP(Internet Control Message Protocol)設定を取得するサンプルプログラムです。名前空間は「Root\Microsoft\HomeNet」、クラスが「Hnet_FwIcmpSettings」になります。
Sample Code
Private Sub Command1_Click()
Dim FisSet As SWbemObjectSet Dim Fis As SWbemObject Dim Locator As SWbemLocator Dim Service As SWbemServices Dim MesStr As String Set Locator = New WbemScripting.SWbemLocator Set Service = Locator.ConnectServer(, "Root\Microsoft\HomeNet") Set FisSet = Service.ExecQuery("Select * From HNet_FwIcmpSettings") For Each Fis In FisSet MesStr = MesStr & "エコー要求の着信:" & Fis.AllowInboundEchoRequest & vbCrLf & _ "マスク要求の着信:" & Fis.AllowInboundMaskRequest & vbCrLf & _ "ルータ要求の着信:" & Fis.AllowInboundRouterRequest & vbCrLf & _ "タイムスタンプ要求の着信:" & Fis.AllowInboundTimestampRequest & vbCrLf & _ "到達できない宛先の送信:" & Fis.AllowOutboundDestinationUnreachable & vbCrLf & _ "パラメータ問題の送信:" & Fis.AllowOutboundParameterProblem & vbCrLf & _ "送信元抑制:" & Fis.AllowOutboundSourceQuench & vbCrLf & _ "時間経過の送信:" & Fis.AllowOutboundTimeExceeded & vbCrLf & _ "リダイレクトを許可:" & Fis.AllowRedirect & vbCrLf Next MsgBox "WindowsファイアウォールのICMP設定の情報です。" & vbCrLf & vbCrLf & _ MesStr & vbCrLf & "ですよ。" Set FisSet = Nothing Set Fis = Nothing Set Service = Nothing Set Locator = Nothing End Sub
Comment
実行すると現在のWindowsファイアウォールのICMP設定内容が表示されます。
Recommended book
個人的にお勧めする本の紹介です。
|
|
ご意見・ご要望・ご感想をこちらのアンケートからお待ちしています |
| ∧ ページの先頭へ… |