AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 30.10.2012, 01:15   #1  
Blog bot is offline
Blog bot
Участник
 
25,643 / 848 (80) +++++++
Регистрация: 28.10.2006
ax-erp: Delete AUC File Of Users
Источник: http://microsoft-dynamics-ax-erp.blo...-of-users.html
==============

X++:
static void ClearAucFileForUsers(Args _args)
{
    System.Array    files;
    int             fileCount;
    int             i;
    str             nextFile;
    str             path = "C:\\Users";
    str             Finalpath;
    str             pattern = "*.auc";
    container       listOfFiles;
    int             DirCount;
   
   
    System.Array    Directories;
    int             j;
    str             nextDir;
    container       listOfDir;
   
    FileIOPermission    dirPermission, filePermission;
    InteropPermission   interopPermission;
    Set                 permissionSet;
   
    new InteropPermission(InteropKind::ClrInterop).assert();
    listOfDir = conNull();
    listOfFiles     = connull();
   
    Directories = System.IO.Directory::GetDirectories(path);
    if(Directories)
    {
        DirCount = Directories.get_Length();
       
        for(j=0; j < DirCount; j++)
        {
            nextDir    = Directories.GetValue(j);
            Finalpath = nextDir + "\\AppData\\Local";
            listOfDir += Finalpath;
        }       
    }
    j=0;
    DirCount = conLen(listOfDir);
    while( j < conLen(listOfDir))
    {
        j++;
        Finalpath = conPeek(listOfDir,j);
        try           
        {
            files           = System.IO.Directory::GetFiles(Finalpath, pattern);
        }
        catch
        {
            continue;   
        }
        if (files)
        {
            fileCount =    files.get_Length();
           
            for(i=0; i < fileCount; i++)
            {
                nextFile    = files.GetValue(i);
                System.IO.File::Delete(nextFile);       
                info(nextFile);
            }
        }
    }
   
    CodeAccessPermission::revertAssert();
}



Источник: http://microsoft-dynamics-ax-erp.blo...-of-users.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.

Последний раз редактировалось Poleax; 30.10.2012 в 11:53. Причина: оформление
Теги
auc, кеш, чистка

 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
ax-erp: Creating SSRS-Reports in Dynamics AX 2012 – What’s no longer possible in AX-reports Blog bot DAX Blogs 0 18.07.2012 12:11
emeadaxsupport: New Content for Microsoft Dynamics AX 2012 : October 2011 Blog bot DAX Blogs 0 27.10.2011 17:11
axinthefield: Dynamics AX Event IDs Blog bot DAX Blogs 0 01.03.2011 22:11
daxdilip: Whats New in Dynamics AX 2012 (A brief extract from the recently held Tech Conf.) Blog bot DAX Blogs 7 31.01.2011 12:35
emeadaxsupport: Identical AX 2009 AUC File Created For Multiple AX Installations Blog bot DAX Blogs 0 25.01.2010 16:05

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 08:03.