public void ConnectionTest() { IBLVMServer server = new IBLVMServer(new SessionControl()); server.Bind(new IPEndPoint(IPAddress.Any, 40001)); server.Listen(5); server.Start(); IBLVMManager manager = new IBLVMManager(); manager.Conncet(new IPEndPoint(AccessIP, 40001)); while (manager.Status != (int)ClientSocketStatus.Connected) { ; } manager.Login("1234", "1234"); while (manager.Status != (int)ClientSocketStatus.LoggedIn) { ; } server.Dispose(); manager.Dispose(); }
public void DeviceListingTest() { bool isEndable = false; IBLVMServer server = new IBLVMServer(new SessionControl()); server.Bind(new IPEndPoint(IPAddress.Any, 40001)); server.Listen(5); server.Start(); IBLVMClient client = new IBLVMClient(); client.Connect(new IPEndPoint(AccessIP, 40001)); while (client.Status != (int)ClientSocketStatus.Connected) { ; } client.Login("1234", "1234"); while (client.Status != (int)ClientSocketStatus.LoggedIn) { ; } IBLVMManager manager = new IBLVMManager(); manager.Conncet(new IPEndPoint(AccessIP, 40001)); while (manager.Status != (int)ClientSocketStatus.Connected) { ; } manager.Login("1234", "1234"); while (manager.Status != (int)ClientSocketStatus.LoggedIn) { ; } manager.OnDevicesReceived += (a) => { foreach (var device in a) { Console.WriteLine(device.ToString()); } isEndable = true; }; manager.GetDeviceList(); while (manager.Status != (int)ClientSocketStatus.LoggedIn || !isEndable) { ; } server.Dispose(); manager.Dispose(); }
public void BitLockerLockTest() { bool isEndable = false; IBLVMServer server = new IBLVMServer(new SessionControl()); server.Bind(new IPEndPoint(IPAddress.Any, 40001)); server.Listen(5); server.Start(); ConnectClient(new IPEndPoint(AccessIP, 40001)); IBLVMManager manager = new IBLVMManager(); manager.Conncet(new IPEndPoint(AccessIP, 40001)); while (manager.Status != (int)ClientSocketStatus.Connected) { ; } manager.Login("1234", "1234"); while (manager.Status != (int)ClientSocketStatus.LoggedIn) { ; } manager.OnDevicesReceived += (devices) => { manager.OnDrivesReceived += (drives) => { manager.OnBitLockerCommandResponseReceived += (isSuccess) => { Console.WriteLine(isSuccess); isEndable = true; }; foreach (var drive in drives) { Console.WriteLine(drive); if (drive.Drive.Name.Contains("E")) { manager.LockBitLockerDrive(devices[0], drive.Drive); } } }; manager.GetDeviceDrives(devices[0]); }; manager.GetDeviceList(); while (manager.Status != (int)ClientSocketStatus.LoggedIn || !isEndable) { ; } server.Dispose(); manager.Dispose(); }