コード例 #1
0
        public static BizTalkServerRegistry GetMgmtServerInfo()
        {
            BizTalkServerRegistry registry = new BizTalkServerRegistry();

            try
            {
                string      name = @"SOFTWARE\Microsoft\BizTalk Server\3.0";
                RegistryKey key  = Registry.LocalMachine.OpenSubKey(name);
                if (key == null)
                {
                    throw new BizTalkRegistryMissingException(string.Format(CultureInfo.CurrentCulture, "Could not locate the BizTalk Registry key. The service must be deployed to a BizTalk Server.  Reg Key Lookup '{0}'.", new object[] { name }));
                }
                registry.InstallPath = (string)key.GetValue("InstallPath");

                RegistryKey subKey = key.OpenSubKey("Administration");
                if (subKey == null)
                {
                    throw new BizTalkRegistryMissingException(string.Format(CultureInfo.CurrentCulture, "Could not locate the BizTalk Registry key. The service must be deployed to a BizTalk Server.  Reg Key Lookup '{0}'.", new object[] { name + "\\Administration" }));
                }
                registry.BizTalkMgmtDbName = (string)subKey.GetValue("MgmtDBName");
                registry.BizTalkMgmtDb     = (string)subKey.GetValue("MgmtDBServer");

                key.Close();
                key = null;
            }
            catch { }

            return(registry);
        }
コード例 #2
0
        public SSO(string companyName)
        {
            _bizTalkEmailAddress =
                string.Format(_bizTalkEmailAddress, companyName);
            string username = ConfigurationManager.AppSettings["Username"];

            if (!string.IsNullOrWhiteSpace(username))
            {
                _bizTalkEmailAddress =
                    string.Format("{0}@{1}.com", username, companyName);
            }
            _registry = BizTalkHelper.GetMgmtServerInfo();
        }
コード例 #3
0
 public SSO(string username, string companyName)
 {
     _bizTalkEmailAddress =
         string.Format("{0}@{1}.com", username, companyName);
     _registry = BizTalkHelper.GetMgmtServerInfo();
 }