IBE.EDDN.EDDNCommunicator.UserIdentification C# (CSharp) Méthode

UserIdentification() public méthode

checks and gets the EDDN id
public UserIdentification ( ) : String
Résultat String
        public String UserIdentification()
        {
            String retValue = "";
            String userName = "";
            Guid parsedGUID;

            try
            {
                retValue = m_lDBCon.getIniValue<String>(IBE.EDDN.EDDNView.DB_GROUPNAME, "UserID");

                if((!Guid.TryParse(retValue, out parsedGUID)) || (!parsedGUID.ToString().Equals(retValue)))
                {
                    retValue = Guid.NewGuid().ToString();
                    m_lDBCon.setIniValue(IBE.EDDN.EDDNView.DB_GROUPNAME, "UserID", retValue);
                }
                    
                if (m_lDBCon.getIniValue(IBE.EDDN.EDDNView.DB_GROUPNAME, "Identification", "useUserName") == "useUserName")
                {
                    userName = m_lDBCon.getIniValue<String>(IBE.EDDN.EDDNView.DB_GROUPNAME, "UserName");

                    if (String.IsNullOrWhiteSpace(userName))
                        m_lDBCon.setIniValue(IBE.EDDN.EDDNView.DB_GROUPNAME, "Identification", "useUserID");
                    else
                        retValue = userName;
                }

                return userName;
            }
            catch (Exception ex)
            {
                throw new Exception("Error while checking the EDDN id", ex);
            }
        }