Beispiel #1
0
        public void FindTypeByFullNameTest()
        {
            ScriptAssemblyInfo target      = new ScriptAssemblyInfo(); // TODO: 初始化为适当的值
            string             strFullName = string.Empty;             // TODO: 初始化为适当的值
            Type expected = null;                                      // TODO: 初始化为适当的值
            Type actual;

            actual = target.FindTypeByFullName(strFullName);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }
        /// <summary>
        /// 读取密码
        /// </summary>
        private static void LoadPassword()
        {
            //////////////////////////////////////////////////////////////////////////
            // 开始在编译后的程序集合内获取密码

            Type type = s_ScriptAssemblyInfo.FindTypeByFullName("Demo.Wow.Scripts.Globals.GlobalConfig");

            if (type != null)
            {
                FieldInfo fieldInfo = type.GetField("SQLPassword");
                if (fieldInfo != null)
                {
                    string strSQLPassword = fieldInfo.GetValue(string.Empty) as string;

                    if (strSQLPassword != null && strSQLPassword != string.Empty)
                    {
                        s_ConfigInfo.WowConfig.SQLPassword = strSQLPassword;
                    }
                }

                fieldInfo = type.GetField("DomainPassword");
                if (fieldInfo != null)
                {
                    string strDomainPassword = fieldInfo.GetValue(string.Empty) as string;

                    if (strDomainPassword != null && strDomainPassword != string.Empty)
                    {
                        s_ConfigZoneClusterWorld.DomainPassword = strDomainPassword;
                    }
                }


                fieldInfo = type.GetField("ZoneClusterPassword");
                if (fieldInfo != null)
                {
                    string strZoneClusterPassword = fieldInfo.GetValue(string.Empty) as string;

                    if (strZoneClusterPassword != null && strZoneClusterPassword != string.Empty)
                    {
                        s_ConfigZoneClusterWorld.ZoneClusterPassword = strZoneClusterPassword;
                    }
                }
            }
        }