Exemple #1
0
        static public List <MercuryUser> GetUsers(string mercuryDir)
        {
            string mailDir   = Path.Combine(mercuryDir, "MAIL");
            string usersFile = Path.Combine(mailDir, "PMAIL.USR");

            List <MercuryUser> result = new List <MercuryUser>();

            string content = File.ReadAllText(usersFile);

            string[] lines = Microsoft.VisualBasic.Strings.Split(content, Environment.NewLine, -1, Microsoft.VisualBasic.CompareMethod.Text);

            foreach (string line in lines)
            {
                string trimmedLine = line.Trim();
                if (trimmedLine.Length <= 3)
                {
                    continue;
                }

                string[] userProperties = trimmedLine.Split(';');

                if (userProperties.Length > 1)
                {
                    MercuryUser user = new MercuryUser();
                    user.Name     = userProperties[1];
                    user.Password = GetMercuryUserPassword(mercuryDir, user.Name);
                    result.Add(user);
                }
            }

            return(result);
        }
Exemple #2
0
      static public List<MercuryUser> GetUsers(string mercuryDir)
      {
         string mailDir = Path.Combine(mercuryDir, "MAIL");
         string usersFile = Path.Combine(mailDir, "PMAIL.USR");
         
         List<MercuryUser> result = new List<MercuryUser>();

         string content = File.ReadAllText(usersFile);
         string[] lines = Microsoft.VisualBasic.Strings.Split(content, Environment.NewLine, -1, Microsoft.VisualBasic.CompareMethod.Text);

         foreach (string line in lines)
         {
            string trimmedLine = line.Trim();
            if (trimmedLine.Length <= 3)
               continue;

            string[] userProperties = trimmedLine.Split(';');

            if (userProperties.Length > 1)
            {
               MercuryUser user = new MercuryUser();
               user.Name = userProperties[1];
               user.Password = GetMercuryUserPassword(mercuryDir, user.Name);
               result.Add(user);
            }
         }

         return result;
      }