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

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 27.05.2009, 09:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,525 / 847 (80) +++++++
Регистрация: 28.10.2006
axaptapedia: Registry client name
Источник: http://www.axaptapedia.com/Registry_client_name
==============

Summary: New page: Having been handed a requirement to connect machines which log onto Axapta 3.0 from Terminal Services and utilize the local Windows XP client hostname, I've found the Windows Registry can ...

Having been handed a requirement to connect machines which log onto Axapta 3.0 from Terminal Services and utilize the local Windows XP client hostname, I've found the Windows Registry can provide one possible solution.


X++:
str getRegistryClientName()
{
    // Get hostname from Terminal Services Session
    #winAPI
    int intHandle;
    container clintName;
    ;
    intHandle = WinAPI::regOpenKey(#HKEY_CURRENT_USER, 'Volatile Environment', #KEY_READ);
    clintName = WinAPI::regGetValue(intHandle, 'CLIENTNAME');
    WinAPI::regCloseKey(intHandle);

    return conpeek(clintName,1);
}

Further into the process you might need to check the value is not of the form CONSOLE, as this would pertain to a locally logged in session, which differs in the Registry Key value. For this I found the winAPI::getComputerName() method was more reasonable.


X++:
void getHostName()
{
    ;
    if(hostName)
        return;

    // assume TS session
    hostName = this.getRegistryClientName();

    if(STRUPR(hostName) == "CONSOLE")// local
    {
         hostName = winAPI::getComputerName();
    }
}

Of course within the Class Declaration it would be a good idea to include the following string!


str hostName;



Источник: http://www.axaptapedia.com/Registry_client_name
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Jim Wang: Get Entity/Attribute's Display Name from CRM database Blog bot Dynamics CRM: Blogs 0 28.03.2009 01:05
axcoder: PowerShell + Ax Blog bot DAX Blogs 1 09.01.2009 18:05
axaptapedia: Create New AOT Project From Template Blog bot DAX Blogs 0 29.08.2008 21:10
axaptapedia: Change table owner Blog bot DAX Blogs 1 22.03.2007 20:56
axaptapedia: Control AOS from command line Blog bot DAX Blogs 0 09.03.2007 14:50

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

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

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 07:46.
Powered by vBulletin® v3.8.5. Перевод: zCarot
Контактная информация, Реклама.