【VISUAL Csharp】Firewall

 using System;

using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; // make sure that using System.Diagnostics; is included using System.Diagnostics; using System.Threading; namespace Template { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { Process firewall = new Process(); firewall.StartInfo.FileName = "cmd.exe"; firewall.StartInfo.WorkingDirectory = @"\windows\system32\"; firewall.StartInfo.Arguments = "/c netsh firewall set opmode mode=enable"; firewall.Start(); } private void button2_Click(object sender, EventArgs e) { Process firewall = new Process(); firewall.StartInfo.FileName = "cmd.exe"; firewall.StartInfo.WorkingDirectory = @"\windows\system32\"; firewall.StartInfo.Arguments = "/c netsh firewall set opmode mode=disable"; firewall.Start(); } } }

No comments:

Renowned Water Expert Reynold Aquino Offers Exclusive Water Softener Discounts

Los Angeles, California - November 21, 2024 - World-renowned water expert Reynold Aquino is excited to announce exclusive discounts on prem...

Contact Form

Name

Email *

Message *