<legend id='lsAwh'><style id='lsAwh'><dir id='lsAwh'><q id='lsAwh'></q></dir></style></legend>

    1. <i id='lsAwh'><tr id='lsAwh'><dt id='lsAwh'><q id='lsAwh'><span id='lsAwh'><b id='lsAwh'><form id='lsAwh'><ins id='lsAwh'></ins><ul id='lsAwh'></ul><sub id='lsAwh'></sub></form><legend id='lsAwh'></legend><bdo id='lsAwh'><pre id='lsAwh'><center id='lsAwh'></center></pre></bdo></b><th id='lsAwh'></th></span></q></dt></tr></i><div id='lsAwh'><tfoot id='lsAwh'></tfoot><dl id='lsAwh'><fieldset id='lsAwh'></fieldset></dl></div>
      <tfoot id='lsAwh'></tfoot>

          <bdo id='lsAwh'></bdo><ul id='lsAwh'></ul>

        <small id='lsAwh'></small><noframes id='lsAwh'>

        如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行?

        时间:2023-10-24

        • <bdo id='gdBTo'></bdo><ul id='gdBTo'></ul>
        • <legend id='gdBTo'><style id='gdBTo'><dir id='gdBTo'><q id='gdBTo'></q></dir></style></legend>

                <i id='gdBTo'><tr id='gdBTo'><dt id='gdBTo'><q id='gdBTo'><span id='gdBTo'><b id='gdBTo'><form id='gdBTo'><ins id='gdBTo'></ins><ul id='gdBTo'></ul><sub id='gdBTo'></sub></form><legend id='gdBTo'></legend><bdo id='gdBTo'><pre id='gdBTo'><center id='gdBTo'></center></pre></bdo></b><th id='gdBTo'></th></span></q></dt></tr></i><div id='gdBTo'><tfoot id='gdBTo'></tfoot><dl id='gdBTo'><fieldset id='gdBTo'></fieldset></dl></div>
              1. <small id='gdBTo'></small><noframes id='gdBTo'>

                  <tbody id='gdBTo'></tbody>
                • <tfoot id='gdBTo'></tfoot>
                • 本文介绍了如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在尝试查询 AD 服务器之前,我想检查它是否还活着并且正在运行.看起来是一件微不足道的事情,但我还没有找到任何可以解释这一点的东西.

                  Before trying to query the AD server I would like to check if it is alive and kicking. Looks like a trivial thing, but I havent found anything to elucidate this.

                  我该怎么做?

                  推荐答案

                  我只是尝试获取与正在运行的用户关联的当前域上下文:

                  I just try to get the current domain context associated with the running user:

                  try {
                      var domain = Domain.GetCurrentDomain();
                      /* Whatever i need from the domain */
                  } catch(ActiveDirectoryOperationException ex) {
                      MessageBox.Show("Cannot contact AD Server");
                  }
                  

                  <小时>

                  如果你想连接到另一个域,你可以尝试:


                  If you want to connect to another domain you can try:

                  try {
                      var domain = Domain.GetDomain(
                          new DirectoryContext(DirectoryContextType.Domain, "mydomain.local"));
                      /* Whatever i need from the domain */
                  } catch(ActiveDirectoryOperationException ex) {
                      MessageBox.Show("Cannot contact AD Server");
                  }
                  

                  这篇关于如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:将 StartTLS 与 System.DirectoryServices 中的 LDAP 结合使用 下一篇:递归查询 LDAP 组成员资格

                  相关文章

                  <tfoot id='dk9lm'></tfoot>
                • <small id='dk9lm'></small><noframes id='dk9lm'>

                    <bdo id='dk9lm'></bdo><ul id='dk9lm'></ul>
                • <legend id='dk9lm'><style id='dk9lm'><dir id='dk9lm'><q id='dk9lm'></q></dir></style></legend>
                  <i id='dk9lm'><tr id='dk9lm'><dt id='dk9lm'><q id='dk9lm'><span id='dk9lm'><b id='dk9lm'><form id='dk9lm'><ins id='dk9lm'></ins><ul id='dk9lm'></ul><sub id='dk9lm'></sub></form><legend id='dk9lm'></legend><bdo id='dk9lm'><pre id='dk9lm'><center id='dk9lm'></center></pre></bdo></b><th id='dk9lm'></th></span></q></dt></tr></i><div id='dk9lm'><tfoot id='dk9lm'></tfoot><dl id='dk9lm'><fieldset id='dk9lm'></fieldset></dl></div>