private void Read_Current_Session() { int counter = 0; int ActiveTime; int itime; string sharename; try { oq = new System.Management.ObjectQuery("SELECT * FROM Win32_ServerConnection"); oq1 = new System.Management.ObjectQuery("SELECT * FROM Win32_ServerSession"); ManagementObjectSearcher searcher = new ManagementObjectSearcher(ms, oq); ManagementObjectSearcher searcher2 = new ManagementObjectSearcher(ms, oq1); // Read the object foreach (ManagementObject ServerQobj in searcher2.Get()) { RemoteOS = ServerQobj["ClientType"].ToString(); IDealTime = ServerQobj["IdleTime"].ToString(); itime = Int32.Parse(IDealTime) / 60; IDealTime = itime.ToString(); } usname = ""; foreach (ManagementObject queryObj in searcher.Get()) { RemoteIPAddress = queryObj["ComputerName"].ToString(); RemoteUserName = queryObj["UserName"].ToString(); RemoteActiveTime = queryObj["ActiveTime"].ToString(); ActiveTime = (Int32.Parse(RemoteActiveTime)) / 60; RemoteActiveTime = ActiveTime.ToString(); sharename = queryObj["ShareName"].ToString(); if (!sharename.Equals("IPC$")) { if (usname != "") { usname = usname + " , " + RemoteUserName; } else { usname = RemoteUserName; } Load_Current_Session(counter, RemoteIPAddress, RemoteUserName, RemoteActiveTime, IDealTime, RemoteOS); load_Access_folder(counter, RemoteUserName, sharename); counter += 1; } } } catch (ManagementException e) { MessageBox.Show("An error occurred while querying for WMI data: " + e.Message); this.Close(); } }
public override string ToString() { string timeInfo = ""; ActiveTime activeTime = ActiveTime.getActiveTimeByID(getSample().timeID); if (activeTime != null) { timeInfo = activeTime.ToString(); Log.info("下次开始" + TimeKit.getDateTime(activeTime.getDetailStartTime()).ToString("yyyy-MM-dd HH:mm:ss")); } else { timeInfo = "永久"; } return(base.ToString() + "\t" + getSample().sid + "\t" + getSample().name + "\t" + getSample().activiteDesc + "\t" + timeInfo + "\t" + getSample().content); }
public override void Save() { XmlDocument doc = new XmlDocument(); XmlElement root = doc.CreateElement("particleemitter"); doc.AppendChild(root); root.AppendChild(doc.CreateElement("material").SimpleTag("name", Material)); root.AppendChild(doc.CreateElement("numparticles").SimpleTag("value", NumParticles.ToString())); root.AppendChild(doc.CreateElement("updateinvisible").SimpleTag("enable", UpdateInvisible ? "true" : "false")); root.AppendChild(doc.CreateElement("relative").SimpleTag("enable", Relative ? "true" : "false")); root.AppendChild(doc.CreateElement("scaled").SimpleTag("enable", Scaled ? "true" : "false")); root.AppendChild(doc.CreateElement("sorted").SimpleTag("enable", Sorted ? "true" : "false")); root.AppendChild(doc.CreateElement("animlodbias").SimpleTag("value", AnimLodBias.ToString())); root.AppendChild(doc.CreateElement("emittertype").ValueTag(Type.ToString().ToLower())); if (EmitterSize != null) { root.AppendChild(doc.CreateElement("emittersize").ValueTag(EmitterSize.ToString())); } root.AppendChild(doc.CreateElement("emitterradius").ValueTag(EmitterRadius.ToString())); XmlElement dir = doc.CreateElement("direction"); dir.SetAttribute("min", DirectionMin.ToString()); dir.SetAttribute("max", DirectionMax.ToString()); root.AppendChild(dir); root.AppendChild(doc.CreateElement("constantforce").ValueTag(ConstantForce.ToString())); root.AppendChild(doc.CreateElement("dampingforce").ValueTag(DampingForce.ToString())); root.AppendChild(doc.CreateElement("activetime").ValueTag(ActiveTime.ToString())); root.AppendChild(doc.CreateElement("inactivetime").ValueTag(InActiveTime.ToString())); root.AppendChild(Interval.ToElement(doc.CreateElement("interval"))); root.AppendChild(EmissionRate.ToElement(doc.CreateElement("emissionrate"))); XmlElement psize = doc.CreateElement("particlesize"); psize.SetAttribute("min", MinSize.ToString()); psize.SetAttribute("max", MaxSize.ToString()); root.AppendChild(psize); root.AppendChild(TimeToLive.ToElement(doc.CreateElement("timetolive"))); root.AppendChild(Velocity.ToElement(doc.CreateElement("velocity"))); root.AppendChild(Rotation.ToElement(doc.CreateElement("rotation"))); root.AppendChild(RotationSpeed.ToElement(doc.CreateElement("rotationspeed"))); //SIZE DELTA XmlElement sized = doc.CreateElement("sizedelta"); sized.SetAttribute("add", SizeDelta.X.ToString()); sized.SetAttribute("mul", SizeDelta.Y.ToString()); root.AppendChild(sized); foreach (ParticleColorFade f in ColorFade) { XmlElement e = doc.CreateElement("colorfade"); e.SetAttribute("color", f.Color.ToString()); e.SetAttribute("time", f.Time.ToString()); root.AppendChild(e); } foreach (ParticleTexAnim a in TextureAnim) { XmlElement e = doc.CreateElement("texanim"); e.SetAttribute("uv", a.Animation.ToString()); e.SetAttribute("time", a.Time.ToString()); root.AppendChild(e); } XmlWriterSettings xws = new XmlWriterSettings { OmitXmlDeclaration = true, Indent = true }; using (XmlWriter xw = XmlWriter.Create(System.IO.Path.ChangeExtension(Name, "xml"), xws)) doc.Save(xw); }
public override Dictionary <string, string> GetCharacterDisplayCalculationValues() { Dictionary <string, string> dictValues = new Dictionary <string, string>(); dictValues.Add("Status", string.Format("Overall: {0,-10} Fight: {1,-10} Burst: {2,-10}", OverallPoints.ToString("N0"), FightPoints.ToString("N0"), BurstPoints.ToString("N0"))); //Basic Stats dictValues["Health"] = BasicStats.Health.ToString("N00"); dictValues["Stamina"] = BasicStats.Stamina.ToString("N00"); dictValues["Mana"] = BasicStats.Mana.ToString("N00"); dictValues["Intellect"] = BasicStats.Intellect.ToString("N00"); dictValues["Spirit"] = BasicStats.Spirit.ToString("N00"); dictValues["Mastery Rating"] = string.Format("{0}*{1} Mastery Rating", (8 + BasicStats.MasteryRating / 179.28f).ToString("N02"), BasicStats.MasteryRating); dictValues["Spell Power"] = string.Format("{0}", SpellPowerTotal.ToString("N00")); dictValues["Mana Regen"] = string.Format("{0}", ManaRegenRate.ToString("N00")); dictValues["Combat Regen"] = string.Format("{0}", CombatRegenRate.ToString("N00")); // dictValues["Mp5"] = BasicStats.Mp5.ToString("N00"); dictValues["Spell Crit"] = string.Format("{0}%*{1} Crit Rating", (BasicStats.SpellCrit * 100).ToString("N02"), BasicStats.CritRating); dictValues["Spell Haste"] = string.Format("{0}%*Haste breakdown:\nHaste Rating {1} gives {2} haste.\nTalent haste multipliers:\nSpeed of Light: {3}\nJudgements of the Pure: {4}\nOther Haste: {5} (probably from buffs)", (BasicStats.SpellHaste * 100).ToString("N02"), BasicStats.HasteRating, (BasicStats.RangedHaste * 100).ToString("N02"), HasteSoL.ToString("N02"), HasteJotP.ToString("N02"), (((1f + BasicStats.SpellHaste) / (1f + BasicStats.PhysicalHaste) - 1f) * 100f).ToString("N02")); // Cycle Stats dictValues["Total Healed"] = string.Format("{0} healing", TotalHealed.ToString("N00")); dictValues["Total Mana"] = string.Format("{0} mana *Mana Sources:\nBase Mana: {1} \nCombat Regen: {2}\nJudgements: {3}\nReplenishment: {4}\nDivine Plea: {5}\nArcane Torrent: {6}\nLay on Hands: {7}\nMP5: {8}\nMelee: {9}\nOther: {10}", TotalMana.ToString("N00"), ManaBase.ToString("N00"), CombatRegenTotal.ToString("N00"), ManaJudgements.ToString("N00"), ManaReplenishment.ToString("N00"), ManaDivinePlea.ToString("N00"), ManaArcaneTorrent.ToString("N00"), ManaLayOnHands.ToString("N00"), ManaMp5.ToString("N00"), ManaMelee.ToString("N00"), ManaOther.ToString("N00")); dictValues["Average Healing per sec"] = string.Format("{0} hps", AvgHPS.ToString("N00")); dictValues["Average Healing per mana"] = string.Format("{0} hpm", AvgHPM.ToString("N02")); dictValues["Fight Length"] = string.Format("{0} sec *{1} Active Time \n{2} Total Cast Time", FightLength.ToString("N00"), ActiveTime.ToString("N00"), RotationTotal.ToString("N00")); // Healing Breakdown dictValues["Holy Light Healed"] = string.Format("{0} *Holy Light Information: \nNumber of Casts: {1}\nTotal cast time: {2} sec\nTotal mana used: {3}", HealedHL.ToString("N00"), HLCasts.ToString("N01"), RotationHL.ToString("N02"), UsageHL.ToString("N00")); dictValues["Divine Light Healed"] = string.Format("{0} *Divine Light Information: \nNumber of Casts: {1}\nTotal cast time: {2} sec\nTotal mana used: {3}", HealedDL.ToString("N00"), DLCasts.ToString("N01"), RotationDL.ToString("N02"), UsageDL.ToString("N00")); dictValues["Flash of Light Healed"] = string.Format("{0} *Flash of Light Information: \nNumber of Casts: {1}\nTotal cast time: {2} sec\nTotal mana used: {3}", HealedFoL.ToString("N00"), FoLCasts.ToString("N01"), RotationFoL.ToString("N02"), UsageFoL.ToString("N00")); HSCasts = HS.Casts(); // I wasn't sure how to print this directly, so I made this variable to get it to work for now dictValues["Holy Shock Healed"] = string.Format("{0} *Holy Shock Information: \nNumber of Casts: {1}\nTotal cast time: {2} sec\nTotal mana used: {3}", HealedHS.ToString("N00"), HSCasts.ToString("N00"), RotationHS.ToString("N02"), UsageHS.ToString("N00")); dictValues["Word of Glory Healed"] = string.Format("{0} *Word of Glory Information: \nNumber of Casts: {1}\nTotal cast time: {2} sec\nTotal mana used: {3}", HealedWoG.ToString("N00"), WoGCasts.ToString("N00"), RotationWoG.ToString("N02"), UsageWoG.ToString("N00")); dictValues["Light of Dawn Healed"] = string.Format("{0} *Light of Dawn Information: \nNumber of Casts: {1}\nTotal cast time: {2} sec\nTotal mana used: {3}", HealedLoD.ToString("N00"), LoDCasts.ToString("N00"), RotationLoD.ToString("N02"), UsageLoD.ToString("N00")); dictValues["Holy Radiance Healed"] = string.Format("{0} *Holy Radiance Information: \nNumber of Casts: {1}\nTotal cast time: {2} sec\nTotal mana used: {3}", HealedHR.ToString("N00"), HRCasts.ToString("N00"), RotationHR.ToString("N02"), UsageHR.ToString("N00")); BoLCasts = BoL.Casts(); // I wasn't sure how to print this directly, so I made this variable to get it to work for now dictValues["Beacon of Light Healed"] = string.Format("{0} *Beacon of Light Information: \nNumber of Casts: {1}\nTotal cast time: {2} sec\nTotal mana used: {3}", HealedBoL.ToString("N00"), BoLCasts.ToString("N00"), RotationBoL.ToString("N02"), UsageBoL.ToString("N00")); LoHCasts = LoH.Casts(); dictValues["Lay on Hands Healed"] = string.Format("{0} *Lay on Hands Information: \nNumber of Casts: {1}\nTotal cast time: {2} sec\nTotal mana used: {3}", HealedLoH.ToString("N00"), LoHCasts.ToString("N00"), RotationLoH.ToString("N02"), UsageLoH.ToString("N00")); //dictValues["Glyph of HL Healed"] = string.Format("{0} ", HealedGHL.ToString("N00")); take this out, seems like this glyph no longer exists dictValues["Protector of the Innocent "] = string.Format("{0} *Protector of the Innocent Info:\nNumber of Casts: {1}", HealedPotI.ToString("N00"), PotICasts.ToString("N00")); dictValues["Enlightened Judgements "] = string.Format("{0} *Enlightened Judgements Info:\nNumber of Casts: {1}", HealedJudge.ToString("N00"), JudgeCasts.ToString("N00")); dictValues["Illuminated Healing"] = string.Format("{0} *These are from the absorb shields, and increase with Mastery stat.\nThe shields often expire or are overwritten.\nSee options tab to adjust the effective %.", HealedIH.ToString("N00")); dictValues["Cleanse casting"] = string.Format("*Based on the settings from the options tab, you cast Cleanse {0} times, using up {1} mana.", CleanseCasts.ToString("N00"), UsageCleanse.ToString("N00")); dictValues["Other Healed"] = string.Format("{0} ", HealedOther.ToString("N00")); //Spell Details dictValues["Holy Light"] = "*" + HL.ToString(); dictValues["Flash of Light"] = "*" + FoL.ToString(); dictValues["Holy Shock"] = "*" + HS.ToString(); dictValues["Divine Light"] = "*" + DL.ToString(); dictValues["Word of Glory(3 holy power)"] = "*" + WoG.ToString(); dictValues["LoD(3 hp, max targets)"] = "*" + LoD.ToString(); dictValues["Holy Radiance (max)"] = "*" + HR.ToString(); dictValues["Lay on Hands"] = "*" + LoH.ToString(); dictValues["Protector of the Innocent"] = "*" + PotI.ToString(); dictValues["Enlightened Judgements"] = "*" + EJ.ToString(); return(dictValues); }