using CounsellorBL.BLStructure; using MonumentDefine; using OT.COM.SignalerMessage; using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; namespace CounsellorBL { public class SystemInfoService : ServiceBase { public CResponseMessage Read(CRequestMessage i_crmInput) { CResponseMessage crmRes = null; do { string codeBase = Assembly.GetExecutingAssembly().GetName().CodeBase; codeBase = codeBase.Substring(0, codeBase.LastIndexOf("/", StringComparison.OrdinalIgnoreCase)); List loRes = new List(); Assembly[] assemblyArray = (from f in AppDomain.CurrentDomain.GetAssemblies() where !f.IsDynamic && f.CodeBase != null && f.FullName.IndexOf("CounsellorBL", StringComparison.OrdinalIgnoreCase) != -1 && f.CodeBase.StartsWith(codeBase, StringComparison.OrdinalIgnoreCase) select f).ToArray(); Assembly abFirst = assemblyArray.FirstOrDefault(); if (abFirst != null) { loRes.Add(new SystemInfo() { item_key = BLWording.BACKEND_VERSION, item_value = FileVersionInfo.GetVersionInfo(abFirst.Location).FileVersion }); } crmRes = new CSuccessResponseMessage(null, i_crmInput); // 填寫回傳 crmRes.param.Add(BLWording.DATA, loRes); } while (false); return crmRes; } } }