Firewall.Block
Skip to content
mnscript
StringResult Firewall.Block(string) 

Description ​

Blocks an IP from communicating with your terminal.

Arguments ​

string - The IP address

Returns ​

StringResult - StringResult representing the success or failure of this operation

Example ​

msc
using System;
using Console;
using Firewall;
using Application;

//Request Admin Perms
Application.RequestAdminPrivilege();

string IP = "1.1.1.1";

StringResult block = Firewall.Block(IP);

if ( block.GetResult() ) {
    Console.WriteLine("Blocked connections from "..IP);
} else {
    Console.WriteLine("Error: "..block.GetString());    
}