Пример #1
0
    public static List <string> GetListMembers(string dName, string uName)
    {
        List <string> userList = new List <string>();

        try
        {
            XMLayer xm = new XMLayer();
            xm = XMServer.CreateXMLayer();
            xm.Login();
            string raw = xm.ListMailingListUsers(dName, uName);
            xm.Logout();
            string line;
            using (StringReader sr = new StringReader(raw))
            {
                while ((line = sr.ReadLine()) != null)
                {
                    line = line.Trim();
                    if (line == ".")
                    {
                        break;
                    }
                    string userAddress    = extractMailingListUserInfo(line, "Address");
                    string userAccess     = "";
                    string userAccessType = extractMailingListUserInfo(line, "AccessType");
                    if (userAccessType.ToUpper().IndexOf("R") > -1)
                    {
                        userAccess = "Read";
                    }
                    if ((userAccessType.ToUpper().IndexOf("R") > -1) &&
                        (userAccessType.ToUpper().IndexOf("W") > -1 ||
                         userAccessType.ToUpper().IndexOf("A") > -1))
                    {
                        userAccess = "Read/Post";
                    }
                    userList.Add(userAddress + " (" + userAccess + ")");
                }
            }
        }
        catch (Exception error)
        {
            Log.WriteException(error);
        }
        return(userList);
    }