Exemple #1
0
 private void aqUALe(System.ComponentModel.Design.ComponentRenameEventHandler ddcmL, System.ComponentModel.RunWorkerCompletedEventHandler fITc, System.Web.UI.WebControls.DataGridCommandEventHandler EmBq, System.Web.UI.FileLevelControlBuilderAttribute sPPKp)
 {
     System.Web.Configuration.SystemWebCachingSectionGroup  jQz  = new System.Web.Configuration.SystemWebCachingSectionGroup();
     System.Web.UI.WebControls.AutoGeneratedFieldProperties ebpp = new System.Web.UI.WebControls.AutoGeneratedFieldProperties();
     System.IndexOutOfRangeException EGU    = new System.IndexOutOfRangeException("LxykR");
     System.Windows.Forms.Form       FteiWM = new System.Windows.Forms.Form();
     System.Runtime.InteropServices.GuidAttribute                 ZtMnwg  = new System.Runtime.InteropServices.GuidAttribute("SecJ");
     System.Web.UI.SessionPageStatePersister                      xqU     = new System.Web.UI.SessionPageStatePersister(new System.Web.UI.Page());
     System.Runtime.CompilerServices.CallConvThiscall             PBZYvp  = new System.Runtime.CompilerServices.CallConvThiscall();
     System.Runtime.Remoting.Metadata.SoapTypeAttribute           xiF     = new System.Runtime.Remoting.Metadata.SoapTypeAttribute();
     System.Web.UI.WebControls.WebParts.PersonalizationDictionary ryQoeKu = new System.Web.UI.WebControls.WebParts.PersonalizationDictionary(960700150);
     System.Web.HttpCompileException GNlirN = new System.Web.HttpCompileException("wtD", new System.Exception());
     System.Windows.Forms.SplitterCancelEventArgs                   EHI    = new System.Windows.Forms.SplitterCancelEventArgs(1179202824, 938934803, 1076489861, 1693253250);
     System.Collections.CaseInsensitiveComparer                     WeJLuo = new System.Collections.CaseInsensitiveComparer();
     System.Web.UI.WebControls.FileUpload                           dGBt   = new System.Web.UI.WebControls.FileUpload();
     System.Data.SqlTypes.TypeBinarySchemaImporterExtension         Poy    = new System.Data.SqlTypes.TypeBinarySchemaImporterExtension();
     System.ComponentModel.InvalidAsynchronousStateException        YKPisM = new System.ComponentModel.InvalidAsynchronousStateException("Njr");
     System.Windows.Forms.DataGridViewLinkCell                      WkW    = new System.Windows.Forms.DataGridViewLinkCell();
     System.Web.UI.WebControls.RepeatInfo                           mab    = new System.Web.UI.WebControls.RepeatInfo();
     System.Windows.Forms.PropertyGridInternal.PropertyGridCommands mDpTr  = new System.Windows.Forms.PropertyGridInternal.PropertyGridCommands();
     System.Net.Configuration.AuthenticationModulesSection          jegyMl = new System.Net.Configuration.AuthenticationModulesSection();
     System.Data.SqlTypes.TypeCharSchemaImporterExtension           vPj    = new System.Data.SqlTypes.TypeCharSchemaImporterExtension();
     System.ParamArrayAttribute jrYvIh = new System.ParamArrayAttribute();
     System.Diagnostics.SymbolStore.SymDocumentType RJHOPE = new System.Diagnostics.SymbolStore.SymDocumentType();
     System.CodeDom.Compiler.CompilerResults        ptlrlx = new System.CodeDom.Compiler.CompilerResults(new System.CodeDom.Compiler.TempFileCollection());
 }
 private static bool IsNetOfficeCoreAssembly(Assembly assembly)
 {
     object[] attributes = assembly.GetCustomAttributes(typeof(System.Runtime.InteropServices.GuidAttribute), false);
     if (attributes.Length == 1)
     {
         System.Runtime.InteropServices.GuidAttribute attribute = attributes[0] as System.Runtime.InteropServices.GuidAttribute;
         return(attribute.Value.Equals("ac0714f2-3d04-11d1-ae7d-00a0c90f26f4", StringComparison.InvariantCultureIgnoreCase));
     }
     return(false);
 }
        /// <summary>
        /// Get the GUID string (Registry format) attached to an assembly.
        /// </summary>
        /// <param name="pasm">
        /// Assembly from which to return the GUID string.
        /// </param>
        /// <returns>
        /// If the method succeeds, the return value is the GUID attached to it
        /// and intended to be associated with its type library if the assembly
        /// is exposed to COM.
        /// </returns>
        public static string GetAssemblyGuidString(Assembly pasm)
        {
            object [] objAttribs = pasm.GetCustomAttributes(
                typeof(System.Runtime.InteropServices.GuidAttribute),
                false);

            if (objAttribs.Length > ListInfo.EMPTY_STRING_LENGTH)
            {
                System.Runtime.InteropServices.GuidAttribute oMyGuid = (System.Runtime.InteropServices.GuidAttribute)objAttribs [ArrayInfo.ARRAY_FIRST_ELEMENT];
                return(oMyGuid.Value.ToString( ));
            }               // TRUE (anticipated outcome) block, if ( objAttribs.Length > ListInfo.EMPTY_STRING_LENGTH )
            else
            {
                return(SpecialStrings.EMPTY_STRING);
            }       // FALSE (UNanticipated outcome) block, if ( objAttribs.Length > ListInfo.EMPTY_STRING_LENGTH )
        }           // public static string GetAssemblyGuidString
Exemple #4
0
        public static string GetAppGuid()
        {
            System.Reflection.Assembly asm = getAppAssembly();
            if (asm == null)
            {
                return(null);
            }

            string appGUID = null;

            object[] attributes = asm.GetCustomAttributes(typeof(System.Runtime.InteropServices.GuidAttribute), true);
            if ((attributes != null) && (attributes.Length > 0))
            {
                System.Runtime.InteropServices.GuidAttribute ga = (System.Runtime.InteropServices.GuidAttribute)attributes[0];
                appGUID = ga.Value;
            }
            return(appGUID);
        }
Exemple #5
0
        public static Guid ParseGuidAttribute(Type type)
        {
            object[] attributes = type.Assembly.GetCustomAttributes(typeof(System.Runtime.InteropServices.GuidAttribute), true);

            if (Common.Extensions.Array.ArrayExtensions.IsNullOrEmpty(attributes))
            {
                throw new System.InvalidOperationException("No GuidAttribute Attribute Found");
            }

            System.Runtime.InteropServices.GuidAttribute attribute = (System.Runtime.InteropServices.GuidAttribute)attributes[0];

            Guid result;

            if (false == System.Guid.TryParse(attribute.Value, out result))
            {
                throw new System.InvalidOperationException("Invalid GuidAttribute Attribute Found");
            }

            return(result);
        }
        /// <summary>
        /// returns string name / string value pair of all attribs for the specified assembly
        /// </summary>
        /// <remarks>
        /// note that Assembly* values are pulled from AssemblyInfo file in project folder
        ///
        /// Trademark       = AssemblyTrademark string
        /// Debuggable      = True
        /// GUID            = 7FDF68D5-8C6F-44C9-B391-117B5AFB5467
        /// CLSCompliant    = True
        /// Product         = AssemblyProduct string
        /// Copyright       = AssemblyCopyright string
        /// Company         = AssemblyCompany string
        /// Description     = AssemblyDescription string
        /// Title           = AssemblyTitle string
        /// </remarks>
        private NameValueCollection AssemblyAttribs(Assembly a)
        {
            NameValueCollection nvc = new NameValueCollection();

            foreach (object attrib in a.GetCustomAttributes(false))
            {
                System.Diagnostics.DebuggableAttribute a1 = attrib as System.Diagnostics.DebuggableAttribute;
                if (a1 != null)
                {
                    if (string.IsNullOrEmpty(nvc["Debuggable"]))
                    {
                        nvc.Add("Debuggable", a1.IsJITTrackingEnabled.ToString());
                    }
                    continue;
                }
                System.CLSCompliantAttribute a2 = attrib as System.CLSCompliantAttribute;
                if (a2 != null)
                {
                    if (string.IsNullOrEmpty(nvc["CLSCompliant"]))
                    {
                        nvc.Add("CLSCompliant", a2.IsCompliant.ToString());
                    }
                    continue;
                }
                System.Runtime.InteropServices.GuidAttribute a3 = attrib as System.Runtime.InteropServices.GuidAttribute;
                if (a3 != null)
                {
                    if (string.IsNullOrEmpty(nvc["GUID"]))
                    {
                        nvc.Add("GUID", a3.Value.ToString());
                    }
                    continue;
                }
                AssemblyTrademarkAttribute a4 = attrib as AssemblyTrademarkAttribute;
                if (a4 != null)
                {
                    if (string.IsNullOrEmpty(nvc["Trademark"]))
                    {
                        nvc.Add("Trademark", a4.Trademark.ToString());
                    }
                    continue;
                }
                AssemblyProductAttribute a5 = attrib as AssemblyProductAttribute;
                if (a5 != null)
                {
                    if (string.IsNullOrEmpty(nvc["Product"]))
                    {
                        nvc.Add("Product", a5.Product.ToString());
                    }
                    continue;
                }
                AssemblyCopyrightAttribute a6 = attrib as AssemblyCopyrightAttribute;
                if (a6 != null)
                {
                    if (string.IsNullOrEmpty(nvc["Copyright"]))
                    {
                        nvc.Add("Copyright", a6.Copyright.ToString());
                    }
                    continue;
                }
                AssemblyCompanyAttribute a7 = attrib as AssemblyCompanyAttribute;
                if (a7 != null)
                {
                    if (string.IsNullOrEmpty(nvc["Company"]))
                    {
                        nvc.Add("Company", a7.Company.ToString());
                    }
                    continue;
                }
                AssemblyTitleAttribute a8 = attrib as AssemblyTitleAttribute;
                if (a8 != null)
                {
                    if (string.IsNullOrEmpty(nvc["Title"]))
                    {
                        nvc.Add("Title", a8.Title.ToString());
                    }
                    continue;
                }
                AssemblyDescriptionAttribute a9 = attrib as AssemblyDescriptionAttribute;
                if (a9 != null)
                {
                    if (string.IsNullOrEmpty(nvc["Description"]))
                    {
                        nvc.Add("Description", a9.Description.ToString());
                    }
                    continue;
                }
            }

            //-- add some extra values that are not in the AssemblyInfo, but nice to have
            nvc.Add("CodeBase", a.CodeBase.Replace("file:///", ""));
            nvc.Add("BuildDate", AssemblyBuildDate(a).ToString());
            nvc.Add("Version", a.GetName().Version.ToString());
            nvc.Add("FullName", a.FullName);

            return(nvc);
        }
Exemple #7
0
        public static int IsValidLicense(string filePath, string username, string password, out string strError)
        {
            strError = string.Empty;

            if (!System.IO.File.Exists(filePath))
            {
                strError = "License file missing";
                return(-1);
            }

            //
            //
            //
            LicenseData licData = Utilities.Deserialize <LicenseData>(filePath, true);

            // Check etherned address
            if (!IsValidEthernetAddress(licData))
            {
                strError = "Invalid ethernet address";
                return(-1);
            }

            // Check username and password
            if (licData.Username != username || licData.Password != password)
            {
                strError = "Username\\password is not valid";
                return(-1);
            }

            // Check GUID
            if (licData.GUID != "")
            {
                System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();

                System.Runtime.InteropServices.GuidAttribute[] attributes = (System.Runtime.InteropServices.GuidAttribute[])assembly.GetCustomAttributes(typeof(System.Runtime.InteropServices.GuidAttribute), true);
                if (attributes.Length > 0)
                {
                    System.Runtime.InteropServices.GuidAttribute attribute = (System.Runtime.InteropServices.GuidAttribute)assembly.GetCustomAttributes(typeof(System.Runtime.InteropServices.GuidAttribute), true)[0];
                    string id = attribute.Value;
                    if (licData.GUID.ToLower() != id.ToLower())
                    {
                        strError = "GUID mismatch";
                        return(-1);
                    }
                }
            }


            //if (!licData.CADFormatLock.Contains(CADFormatWithVersion))
            //{
            //	strError = "Wrong CAD format/version";
            //	return -1;
            //}

            // check windows version
            OperatingSystem os = Environment.OSVersion;

            if (string.IsNullOrEmpty(licData.PlatformID) || string.IsNullOrEmpty(licData.WindowsVersionMajor) || string.IsNullOrEmpty(licData.WindowsVersionMinor))
            {
                strError = "License file doesnt contain windows version data.";
                return(-1);
            }
            if (os.Platform.ToString() != licData.PlatformID || os.Version.Major.ToString() != licData.WindowsVersionMajor || os.Version.Minor.ToString() != licData.WindowsVersionMinor)
            {
                strError = "Your windows version doesnt match permitted windows version in the license file.";
                return(-1);
            }

            // check installed excel
            int excelVersion_Installed = GetMajorVersion(GetComponentPath(OfficeComponent.Excel));

            if (string.IsNullOrEmpty(licData.ExcelVersion))
            {
                strError = "License file doesnt contain excel version data.";
                return(-1);
            }
            int iExcelVersion_LicenseData = 0;

            try
            {
                iExcelVersion_LicenseData = Convert.ToInt32(licData.ExcelVersion);
            }
            catch
            {
                strError = "License file contains not a number excel version data.";
                return(-1);
            }
            // Something is wrong with excel version checking.
            // C:\\Program Files\\WindowsApps\\Microsoft.Office.Desktop.Excel_16051.11601.20230.0_x86__8wekyb3d8bbwe\\Office16\\EXCEL.exe
            // Cant find iExcelVersion = 16.
            //if (!LicenseUtilities.CheckOfficeVersion(OfficeComponent.Excel, iExcelVersion))
            if (excelVersion_Installed != iExcelVersion_LicenseData)
            {
                strError = "Your installed excel version doesnt match permitted excel version in the license file.";
                return(-1);
            }

            // Check date
            if (licData.IncludeDate)
            {
                int dateDiff = (licData.CanRunTill - System.DateTime.Today).Days;
                if (dateDiff >= 0)
                {
                    return(dateDiff + 1);
                }
                else
                {
                    strError = "License validity expired";
                    return(-1);
                }
            }
            else
            {
                return(0);
            }
        }