private static void LogHeader() { writer_.WriteLine("************* Start Display Current Environment *************"); writer_.WriteLine("Process Name :- " + processName); writer_.WriteLine("Process Id :- " + processId); writer_.WriteLine("Machine Name :- " + Environment.MachineName); writer_.WriteLine("OS Version :- " + Environment.OSVersion); writer_.WriteLine(".NET Version :- " + Environment.Version); writer_.WriteLine("Product Long Name :- WebSphere MQ for Windows"); writer_.WriteLine("Version :- " + CommonServices.GetVRMF()); writer_.WriteLine("Installation Path :- " + CommonServices.GetInstallationPath()); writer_.WriteLine("Installation Name :- " + CommonServices.GetInstallationName()); writer_.WriteLine("Date/Time :- " + DateTime.Now.ToString("F")); writer_.WriteLine("Date/Time(UTC) :- " + DateTime.UtcNow.ToString("F")); writer_.WriteLine(); writer_.WriteLine(); writer_.WriteLine("TimeStamp PID.TID Data"); writer_.WriteLine(new string('=', 100)); writer_.WriteLine(); }
public void InitializeNativeApis(string mode) { try { lock (nativeSynchronizer) { if (nativeDllPath == null) { nativeDllPath = CommonServices.GetInstallationPath();//读取安装地址 吴冬 nativeDllPath = "C:\\Program Files (x86)\\IBM\\WebSphere MQ"; //nativeDllPath = System.Environment.CurrentDirectory; nativeDllPath = nativeDllPath.TrimEnd(new char[] { '\\' }); if (CommonServices.Is64bitCLR()) { nativeDllPath = nativeDllPath + @"\bin64\"; } else { nativeDllPath = nativeDllPath + @"\bin\"; } pMqeDll = NativeMQEDll.LoadLibrary(nativeDllPath + "mqe.dll"); if (pMqeDll == IntPtr.Zero) { throw new Exception("Failed to load mqe.dll from folder " + nativeDllPath); } } Type importedApis = null; if ((mode == "MQSeries Client") && !unmanagedInitialized) { importedApis = ImportNativeApis(typeof(NativeUnmanaged), "NativeUnmanaged", mode); this.InitializeNativeCommonApis(importedApis); this.InitializeUnmanagedSpecificApis(importedApis); unmanagedInitialized = true; } else if ((mode == "MQSeries XA Client") && !unmanagedXaInitialized) { importedApis = ImportNativeApis(typeof(NativeXAUnmanaged), "NativeXAUnmanaged", mode); this.InitializeNativeCommonApis(importedApis); this.InitializeUnmanagedXASpecificApis(importedApis); unmanagedXaInitialized = true; } else if ((mode == "MQSeries Bindings") && !bindingsInitialized) { importedApis = ImportNativeApis(typeof(NativeBindings), "NativeBindings", mode); this.InitializeNativeCommonApis(importedApis); this.InitializeBindingsSpecificApis(importedApis); bindingsInitialized = true; } else if ((mode == "IBM.WMQ.MQCommonServices") && !commonServiceInitialized) { InitializeCommonServiceApis(ImportNativeApis(typeof(NativeCommonService), "NativeCommonService", mode)); commonServiceInitialized = true; } } } catch (Exception exception) { throw exception; } }