Rev*_*thi 5 file x++ axapta dynamics-ax-2009
如何使用X ++在Microsoft Dynamics AX 2009中获取PDF文件的创建日期?
如何在按钮单击中打开该PDF文件?
没有功能构建,但你可以问Windows.
WinAPi getFileTime函数返回文件时结构.但是参数和返回值都有点难以接口(查看AX WinAPI类中的其他函数).
更容易的是.Net getCreationTime方法的接口(确实在WinAPI中定义):
client static UTCDateTime getFileCreationTime(str name)
{
return CLRSystemDateTime2UtcDateTime(System.IO.File::GetCreationTime(name));
}
Run Code Online (Sandbox Code Playgroud)
要像以下一样使用:
static void Job1(Args _args)
{;
info(strFmt("%1", WinAPi::getFileCreationTime(@"C:\Users\zjbk\My Documents\ActionTool_SysFlushDictionaryServer.xpo")));
}
Run Code Online (Sandbox Code Playgroud)
要使用默认查看器打开PDF或任何文件:
WinAPI::ShellExecute(@"C:\test.pdf");
Run Code Online (Sandbox Code Playgroud)