Microsoft.HockeyApp.Channel.Storage.GetApplicationIdentity C# (CSharp) Méthode

GetApplicationIdentity() private static méthode

private static GetApplicationIdentity ( ) : string
Résultat string
        private static string GetApplicationIdentity()
        {
            // get user
            string user = string.Empty;
            try
            {
                user = WindowsIdentity.GetCurrent().Name;
            }
            catch (Exception e)
            {
                CoreEventSource.Log.LogVerbose(string.Format(CultureInfo.InvariantCulture, "GetApplicationIdentity: Failed to read user identity. Exception: {0}", e));
            }

            // get domain's directory
            string domainDirecotry = string.Empty;
            try
            {
                domainDirecotry = AppDomain.CurrentDomain.BaseDirectory;
            }
            catch (AppDomainUnloadedException e)
            {   
                CoreEventSource.Log.LogVerbose(string.Format(CultureInfo.InvariantCulture, "GetApplicationIdentity: Failed to read the domain's base directory. Exception: {0}", e));
            }

            // get process name
            string processName = string.Empty;
            try
            {
                processName = Process.GetCurrentProcess().ProcessName;
            }
            catch (Exception e)
            {
                CoreEventSource.Log.LogVerbose(string.Format(CultureInfo.InvariantCulture, "GetApplicationIdentity: Failed to read the process name. Exception: {0}", e));
            }

            return string.Format(CultureInfo.InvariantCulture, "{0}@{1}{2}", user, domainDirecotry, processName);
        }