<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 服务器是否已启动并正在运行?

        How to check if a Active Directory server is up and running using .Net?(如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行?)

        • <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 服务器是否已启动并正在运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Adding and removing users from Active Directory groups in .NET(在 .NET 中的 Active Directory 组中添加和删除用户)
                  How do you determine if two HashSets are equal (by value, not by reference)?(您如何确定两个 HashSet 是否相等(按值,而不是按引用)?)
                  Is there a quot;Setquot; data structure in .Net?(有没有“套路?.Net 中的数据结构?)
                  Collection that allows only unique items in .NET?(仅允许 .NET 中唯一项目的集合?)
                  Adding headers in ASP.NET MVC 3(在 ASP.NET MVC 3 中添加标头)
                  Response.Redirect strips Header Referrer - Possible to Add it Back?(Response.Redirect 剥离 Header Referrer - 可以将其添加回来吗?)
                  <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>

                          <tbody id='dk9lm'></tbody>