/// <summary> /// Remove all loopback interfaces. By default only removes interfaces created with /// Loopback.NET but can also remove other loop back interfaces /// </summary> /// <param name="onlyLoopbackNetIfaces">True to remove only interfaces created with Loopback.NET, false to remove all</param> public static void RemoveAll(bool onlyLoopbackNetIfaces = true) { string idToRemove; if (onlyLoopbackNetIfaces) { // Adding wildcard (*) to capture all matchinv devices idToRemove = _LPNET_TOKEN_PREFIX + "*"; } else { // Adding wildcard (*) to capture all matchinv devices idToRemove = _MSLOOP_DEFAULT_HWID + "*"; } DevconHelper.Remove(idToRemove); }
/// <summary> /// Remove a specific Loopback device /// </summary> /// <param name="loopback">Device to remove</param> public static void Remove(LoopbackInterface loopback) { DevconHelper.Remove(loopback.RemovalToken); }