UtilHostsAdd(Boolean, String, String, String) Method

Adds a new mapping in the Hosts file.

Definition

Namespace: DevCase.Core.Networking.Security
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static void Add(
	bool enabled,
	string hostName,
	string ip,
	string comment = null
)

Parameters

enabled  Boolean
If , enables the mapping.
hostName  String
The hostname.
ip  String
The Ip address.
comment  String  (Optional)
A comment for this mapping.

Exceptions

FileNotFoundException Hosts file not found.
FormatException Invalid Ip adress.
Exception Hostname is already mapped.

See Also