20.07.2007, 18:00 | #1 |
Участник
|
axaptapedia: WMI
Источник: http://www.axaptapedia.com/WMI
============== Summary: New page: == Using WMI in Axapta 3.xxx == === List of all processes with creation time and owner === static void Test_WMIListProcesses(Args _args) { COM WMIService = COM::getObjectEx(@"w... == Using WMI in Axapta 3.xxx == === List of all processes with creation time and owner === static void Test_WMIListProcesses(Args _args) { COM WMIService = COM::getObjectEx(@"winmgmts:{impersonationLevel=impersonate}!\.\root\cimv2"); COM processes = WMIService.ExecQuery("Select * from Win32_Process");// where Name='excel.exe'"); COMVariant userName = new COMVariant(COMVariantInOut::Out, COMVariantType::VT_BSTR); COMVariant userDomain = new COMVariant(COMVariantInOut::Out, COMVariantType::VT_BSTR); COMEnum2Object i = new COMEnum2Object(processes); COM process = i.getFirst(); str time; str reformatTime(str _WMITimeStamp) { str yy = subStr(_WMITimeStamp, 1, 4); str mm = subStr(_WMITimeStamp, 5, 2); str dd = subStr(_WMITimeStamp, 7, 2); str hh = subStr(_WMITimeStamp, 9, 2); str m = subStr(_WMITimeStamp, 11, 2); return dd+'.'+mm+'.'+yy+' '+ hh +':' + m; } ; while(process) { info(process.Name()); if (process.Name()!='System Idle Process' && process.Name()!='System' ) { time = process.CreationDate(); info(reformatTime(time)); process.GetOwner(userName, userDomain); info( userName.bStr() + " | " + userDomain.bStr()); } process = i.getNext(); } } Источник: http://www.axaptapedia.com/WMI
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
Похожие темы | ||||
Тема | Ответов | |||
axcoder: PowerShell + Ax | 1 | |||
axaptapedia: Load Web Documents | 1 | |||
axaptapedia: Tutorial Form Dynalink | 0 | |||
axcoder: AxPath is supported by axaptapedia | 0 |
|