示例#1
0
 public Task ConfigureNetworkInterfaceAsync(NetworkInterfaceConfig config)
 {
     return(Task.Run(() => ConfigureNetworkInterface(config)));
 }
        public static void AddIPAddressToNetworkInterface(NetworkInterfaceConfig config)
        {
            var command = @"netsh interface ipv4 add address '" + config.Name + @"' " + config.IPAddress + @" " + config.Subnetmask;

            PowerShellHelper.ExecuteCommand(command, true);
        }
示例#3
0
        public static void RemoveIPAddressFromNetworkInterface(NetworkInterfaceConfig config)
        {
            var command = @"netsh interface ipv4 delete address '" + config.Name + @"' " + config.IPAddress;

            PowerShellHelper.ExecuteCommand(command, true);
        }
 public static Task AddIPAddressToNetworkInterfaceAsync(NetworkInterfaceConfig config)
 {
     return(Task.Run(() => AddIPAddressToNetworkInterface(config)));
 }
示例#5
0
 public static Task RemoveIPAddressFromNetworkInterfaceAsync(NetworkInterfaceConfig config)
 {
     return(Task.Run(() => RemoveIPAddressFromNetworkInterface(config)));
 }