2.1.25.59 okutil_is_group_server


Description

Check if computer is the group server.

Syntax

BOOL okutil_is_group_server(string* pstrServerGroupFolderPath=NULL, string* pstrGroupServerComputer = NULL, BOOL bForceRead = true, string* pstrServerGroupFolderLocalPath=NULL, int nPathIndex=1)

Parameters

pstrServerGroupFolderPath
[output] optional string to receive the server group folder path (UNC)
pstrGroupServerComputer
[output] optional string to receive group server computer name
bForceRead
[input] info for this function is internally cached to allow faster reading on repeated call (bForceRead =false)
pstrServerGroupFolderLocalPath
[output] optional string to receive group folder local path if available
nPathIndex
[input] specify the index of group folder

Return

true if computer is the group server, otherwise false.

Examples

EX1

void okutil_is_group_server_ex1()
{
    string strComputer;
    if(okutil_is_group_server(NULL, &strComputer))
        out_str("Yes, we are the group server");
    else
    {
        string strThisComputer;
        okutil_get_computer_name(&strThisComputer);
        printf("Sorry, group server is %s and this is %s\n", strComputer, strThisComputer);
    }
}

EX2

void okutil_is_group_server_ex2()
{
    string strComputer, strFolderPath, strFolderLocalPath;
    if(okutil_is_group_server(&strFolderPath, &strComputer, false, &strFolderLocalPath))
    {
        out_str("Yes, we are the group server");
        printf("The server group folder path is %s, the server computer name is %s and the group folder local path is %s\n", strFolderPath, strComputer, strFolderLocalPath);
    }
    else
    {
        string strThisComputer;
        okutil_get_computer_name(&strThisComputer);
        printf("Sorry, group server is %s and this is %s\n", strComputer, strThisComputer);
    }
}

Remark

See Also

okutil_set_group_server

Header to Included

origin.h

Reference