UtilHostsAdd(Boolean, String, String, String) Method
Adds a new mapping in the Hosts file.
Namespace: DevCase.Core.Networking.SecurityAssembly: 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
)
Public Shared Sub Add (
enabled As Boolean,
hostName As String,
ip As String,
Optional comment As String = Nothing
)
Dim enabled As Boolean
Dim hostName As String
Dim ip As String
Dim comment As String
UtilHosts.Add(enabled, hostName, ip, comment)
public:
static void Add(
bool enabled,
String^ hostName,
String^ ip,
String^ comment = nullptr
)
static member Add :
enabled : bool *
hostName : string *
ip : string *
?comment : string
(* Defaults:
let _comment = defaultArg comment null
*)
-> unit
No code example is currently available or this language may not be supported.
Parameters
- enabled Boolean
-
If , enables the mapping.
- hostName String
-
The hostname.
- ip String
-
The Ip address.
- comment String (Optional)
-
A comment for this mapping.
FileNotFoundException
|
Hosts file not found.
|
FormatException
|
Invalid Ip adress.
|
Exception
|
Hostname is already mapped.
|