internal void AddClient() { try { client = new CollectorClient(); var time = System.Environment.TickCount; client.Init(); while (client.IsReady() != IdentaZone.ReturnTypes.rtOK) { Thread.Sleep(100); } time = System.Environment.TickCount - time; Console.WriteLine("Init has taken {0} ticks", time); client.AddCryptoProvider("MS CRYPTO"); client.AddCryptoProvider("SuperBlowFish"); //client.ShowDialog(); client.ShowDialogEx(new IdentaZone.CollectorDialogData() { Filename = "test.iz", Username = "******" }); } catch (Exception ex) { Console.WriteLine(ex); } }
internal void ShowNewGUI() { try { client = new CollectorClient(); var time = System.Environment.TickCount; client.Init(); while (client.IsReady() != IdentaZone.ReturnTypes.rtOK) { Thread.Sleep(100); } time = System.Environment.TickCount - time; Console.WriteLine("Init has taken {0} ticks", time); client.AddCryptoProvider("MS CRYPTO"); client.AddCryptoProvider("SuperBlowFish"); IdentaZone.CollectorDialogData data = new IdentaZone.CollectorDialogData() { Filename = "test.izbiosecure", Username = "******", mode = IdentaZone.CollectorDialogMode.cdmDecryptNoOverwrite }; client.ShowDialogEx(data); } catch (Exception ex) { Console.WriteLine(ex); } }
protected override void OnStop() { try { TraceLog.TraceInfo("Stopping Capture Service"); CollectorClient.Stop(); UploadClient.Stop(); } catch (Exception ex) { TraceLog.TraceException("OnStop: Caught exception", ex); throw ex; } }
static void Main(string[] args) { TraceLog.TraceDestination = TraceLog.Destination.Console; CollectorClient.Start(); UploadClient.Start(); Console.WriteLine("Press any key to stop collection"); Console.ReadLine(); CollectorClient.Stop(); UploadClient.Stop(); Console.WriteLine("Press any key to exit"); Console.ReadLine(); }
protected override void OnStart(string[] args) { try { // set the current directory to the service directory (default is SYSTEM32) System.IO.Directory.SetCurrentDirectory(System.AppDomain.CurrentDomain.BaseDirectory); // set the trace destination TraceLog.TraceDestination = TraceLog.Destination.File; TraceFile.TraceName = @"CaptureService"; TraceLog.TraceInfo("Starting Capture Service"); CollectorClient.Start(); UploadClient.Start(); } catch (Exception ex) { TraceLog.TraceException("OnStart: Caught exception, Start aborted", ex); throw ex; } }
protected override bool OnPowerEvent(PowerBroadcastStatus powerStatus) { TraceLog.TraceInfo("Power event: " + powerStatus.ToString()); switch (powerStatus) { case PowerBroadcastStatus.ResumeAutomatic: case PowerBroadcastStatus.ResumeCritical: case PowerBroadcastStatus.ResumeSuspend: try { TraceLog.TraceInfo("Resuming: power state " + powerStatus.ToString()); CollectorClient.Start(); UploadClient.Start(); } catch (Exception ex) { TraceLog.TraceException("OnPowerEvent: Caught exception, Resume processing aborted", ex); throw; } break; } return(base.OnPowerEvent(powerStatus)); }
private void AddUserAndActivate(CollectorClient user, SymbolModel smb) { _adminService.TickNetSymbolAccesRank[smb.SymbolName].Add(user); try { user.TickNetProxy.ActivateClient(smb.SymbolName); } catch (Exception ex) { Console.WriteLine(ex); ActivateNextClient(smb); } DataManager.AddNewLog(new LogModel { Application = "TickNet", Date = DateTime.Now, Status = 3, Symbol = smb.SymbolName, UserId = _users.Find(oo => oo.Name == user.UserName).Id, LogId = 2, MsgType = 2 }); AddSymbolToBusySymbols(smb); }