private void ListenThreadFun() { while (isListenThreadRun) { if (VirtualPipe.isS2V) { VS_Msg getmsg = VirtualPipe.GetS2VMessage(); switch (getmsg.type) { case MsgType.TYPE.SHOWLOG: { _mainwin.SetRichText(getmsg.content); } break; case MsgType.TYPE.SETPROGRESS: { String[] getTemp = getmsg.content.Split(','); if (getTemp.Length != 3) { break; } bool isAdd = false; int val = 0; int max = 100; if (getTemp[0].Equals("true")) { isAdd = true; } bool flag = int.TryParse(getTemp[1], out val); bool flag_ = int.TryParse(getTemp[2], out max); if (flag && flag_) { _mainwin.SetProgressBar(isAdd, val, max); } else { String err = "val invalid"; } } break; case MsgType.TYPE.EnableLock: { _mainwin.SetBtnEnbale(); } break; default: break; } } Thread.Sleep(10); } }
private void ListenThreadFun() { while (isListenRun) { if (VirtualPipe.isV2S) { VS_Msg getmsg = VirtualPipe.GetV2SMessage(); switch (getmsg.type) { case MsgType.TYPE.GETALL: { //启动磁盘信息服务,获取加密的磁盘 GetDiskServer getdiskServer = new GetDiskServer(); ArrayList bitdisk = getdiskServer.GetAllBitLockerDisk(); String resultString = "@加密磁盘列表:"; foreach (String name in bitdisk) { resultString += ("[" + name + "] "); } VS_Msg msg = new VS_Msg(); msg.type = MsgType.TYPE.SHOWLOG; msg.content = resultString; Program.servercontrol.Send2View(msg); msg = new VS_Msg(); msg.type = MsgType.TYPE.EnableLock; Program.servercontrol.Send2View(msg); msg = new VS_Msg(); msg.type = MsgType.TYPE.SHOWLOG; msg.content = "@:磁盘列表识别完毕,加锁操作执行完毕!"; Program.servercontrol.Send2View(msg); } break; default: break; } } Thread.Sleep(10); } }
public void Send2Server(VS_Msg msg) { VirtualPipe.Send2S(msg); }
public void Send2View(VS_Msg msg) { VirtualPipe.Send2V(msg); }