public void handler(object source, ToolSpecificEventargs arg) { this.WriteToNTEventLog( String.Format("Suspicious popup posted by Process {0}\n{1}\nDialog Text:{2}\nWindow Title:{3}\nMore Info: {4}", arg.processID, arg.CommandLine, arg.DialogText, arg.WindowTitle, arg.MoreData)); }
public void FireToolSpecificEvent(int value) { ToolSpecificEventargs arg = new ToolSpecificEventargs(); if (ActionEvent != null) { arg.processID = value; ActionEvent(this, arg); } }
public void FireToolSpecificEvent() { ToolSpecificEventargs arg = new ToolSpecificEventargs(); if (ActionEvent != null) { arg.processID = count++; arg.processID = -1; arg.CommandLine = String.Empty; arg.WindowTitle = String.Empty; arg.DialogText = String.Empty; ActionEvent(this, arg); } }
// [Conditional("Debug")] private void Action(ToolSpecificEventargs arg) { // Create a new NameValueCollection instance to hold some custom parameters to be posted to the URL. NameValueCollection myNameValueCollection = new NameValueCollection(); string BuildMachine = System.Environment.GetEnvironmentVariable("COMPUTERNAME"); string UserName = System.Security.Principal.WindowsIdentity.GetCurrent().Name; #if DEBUG // Maintain VBLMonitor and VBLManager Console.WriteLine("I see you."); // if (DEBUG ) { Console.WriteLine("\nUploading to {0} ...", uriString); Console.WriteLine("\nComputer {0}", BuildMachine); Console.WriteLine("\nApplication {0}", arg.CommandLine); Console.WriteLine("\nWindow Title {0}", arg.WindowTitle); Console.WriteLine("\nDialog Text {0}", arg.DialogText); Console.WriteLine("\nMore Info: {0}", arg.MoreData); // } System.Diagnostics.Debug.Assert(uriString != null); #else byte[] responseArray = null; // Add necessary parameter/value pairs to the name/value container. myNameValueCollection.Add("Computer", BuildMachine); myNameValueCollection.Add("Application", arg.CommandLine); // command line myNameValueCollection.Add("Window Title", arg.WindowTitle); myNameValueCollection.Add("Dialog Text", arg.DialogText); myNameValueCollection.Add("More Info", String.Format("{0} {1}", "Drive", arg.MoreData)); try { // Upload the NameValueCollection. responseArray = myWebClient.UploadValues(uriString, "POST", myNameValueCollection); // Decode and display the response. if (DEBUG) { Console.WriteLine("\nResponse received was:\n{0}", Encoding.ASCII.GetString(responseArray)); } } catch (Exception e) { Console.WriteLine(e.ToString()); } #endif return; }
public void FireToolSpecificEvent(int ProcessID, string CommandLine, string WindowTitle, string DialogText) { // More Info not Passed ! ToolSpecificEventargs arg = new ToolSpecificEventargs(); if (ActionEvent != null) { arg.processID = ProcessID; arg.CommandLine = CommandLine; arg.WindowTitle = WindowTitle; arg.DialogText = DialogText; DosDriveInventory DosDI = new DosDriveInventory(); DosDI.Execute(); arg.MoreData = DosDI.ReportMappedDosDrives(CommandLine); ActionEvent(this, arg); } }
public void handler(object source, ToolSpecificEventargs arg) { Console.WriteLine(String.Format("Event received by an X object\n{0}\n{1}\n{2}\n{3}\n", arg.processID, arg.CommandLine, arg.DialogText, arg.WindowTitle)); }
public void handler(object source, ToolSpecificEventargs arg) { Action(arg); }
// [Conditional("Debug")] private void Action(ToolSpecificEventargs arg) { // Create a new NameValueCollection instance to hold some custom parameters to be posted to the URL. NameValueCollection myNameValueCollection = new NameValueCollection(); string BuildMachine = System.Environment.GetEnvironmentVariable("COMPUTERNAME"); string UserName = System.Security.Principal.WindowsIdentity.GetCurrent().Name; #if DEBUG // Maintain VBLMonitor and VBLManager Console.WriteLine("I see you."); // if (DEBUG ) { Console.WriteLine("\nUploading to {0} ...", uriString); Console.WriteLine("\nComputer {0}", BuildMachine); Console.WriteLine("\nApplication {0}", arg.CommandLine); Console.WriteLine("\nWindow Title {0}", arg.WindowTitle); Console.WriteLine("\nDialog Text {0}", arg.DialogText); Console.WriteLine("\nMore Info: {0}", arg.MoreData); // } System.Diagnostics.Debug.Assert(uriString != null); #else byte[] responseArray = null; // Add necessary parameter/value pairs to the name/value container. myNameValueCollection.Add("Computer", BuildMachine ); myNameValueCollection.Add("Application", arg.CommandLine ); // command line myNameValueCollection.Add("Window Title", arg.WindowTitle); myNameValueCollection.Add("Dialog Text", arg.DialogText); myNameValueCollection.Add("More Info", String.Format("{0} {1}", "Drive", arg.MoreData) ); try { // Upload the NameValueCollection. responseArray = myWebClient.UploadValues(uriString, "POST", myNameValueCollection); // Decode and display the response. if (DEBUG ) Console.WriteLine("\nResponse received was:\n{0}", Encoding.ASCII.GetString(responseArray)); } catch (Exception e) { Console.WriteLine(e.ToString()); } #endif return; }