Opc.Ua.Configuration.UserNameCreator.Delete C# (CSharp) Method

Delete() public method

Delete a User.
public Delete ( string applicationName, string userName ) : bool
applicationName string The Application Name.
userName string The UserName.
return bool
        public bool Delete(string applicationName, string userName)
        {
            lock (m_lock)
            {
                string relativePath = Utils.Format("%CommonApplicationData%\\OPC Foundation\\Accounts\\{0}\\{1}.xml", applicationName, userName);
                string absolutePath = Utils.GetAbsoluteFilePath(relativePath, false, false, true);

                // oops - nothing found.
                if (absolutePath == null)
                {
                    absolutePath = Utils.GetAbsoluteFilePath(relativePath, true, false, true);
                }

                if (File.Exists(absolutePath))
                {   // delete a file.
                    File.Delete(absolutePath);
                }

                return m_UserNameIdentityTokens.Remove(userName);
            }
        }