Abstractions.Windows.User.GetProfileDir C# (CSharp) Метод

GetProfileDir() публичный статический Метод

returns profiledir based on regkey
public static GetProfileDir ( System.Security.Principal.SecurityIdentifier sid ) : List
sid System.Security.Principal.SecurityIdentifier
Результат List
        public static List<string> GetProfileDir(SecurityIdentifier sid)
        {
            List<string> ret = new List<string>();

            //"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-5-21-534125731-1308685933-1530606844-1000}"
            using (RegistryKey key = Registry.LocalMachine.OpenSubKey(ROOT_PROFILE_KEY))
            {
                if (key != null)
                {
                    foreach (string keyName in key.GetSubKeyNames())
                    {
                        if (keyName.Contains(sid.ToString())) //get the %SID% and %SID%.bak key
                        {
                            using(RegistryKey subKey = Registry.LocalMachine.OpenSubKey(string.Format("{0}\\{1}", ROOT_PROFILE_KEY, keyName)))
                            {
                                LibraryLogging.Info("ProfileList key found {0}", keyName);
                                ret.Add(subKey.GetValue("ProfileImagePath", "", RegistryValueOptions.None).ToString());
                            }
                        }
                    }
                }
                else
                {
                    LibraryLogging.Info("GetProfileDir key {0} not found", ROOT_PROFILE_KEY);
                }
            }

            return ret;
        }

Same methods

User::GetProfileDir ( string username, string password, System.Security.Principal.SecurityIdentifier sid ) : string