public static void ReportStartup(SQLLib sql, string MachineID, string Method, StartupItem AR, ReportingFlags Flags) { Flags &= ~(ReportingFlags.AdminReported | ReportingFlags.ClientReported | ReportingFlags.UrgentAdminReported | ReportingFlags.UrgentClientReported); ReportingStartup a = new ReportingStartup(); a.Action = Method; a.App = AR; sql.InsertMultiData("Reporting", new SQLData("MachineID", MachineID), new SQLData("Type", ReportingPolicyType.Startup), new SQLData("Data", JsonConvert.SerializeObject(a)), new SQLData("Flags", Flags)); }
public string Explain(string JSON) { if (JSON == null) { return("Startup: no data"); } try { ReportingStartup rd = JsonConvert.DeserializeObject <ReportingStartup>(JSON); string res = "Action: " + rd.Action + "\r\n"; res += rd.App.Key + "\r\n"; res += "Location: " + rd.App.Location + "\r\n"; res += "Item: " + rd.App.Item + "\r\n"; res += "HKCUUser: "******"HKLM SYSTEM" : rd.App.HKCUUser); return(res); } catch { return("Startup Data faulty: " + JSON); } }