访问使用C的Active Directory [英] Accessing Active Directory using C

查看:181
本文介绍了访问使用C的Active Directory的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图从后的 http://www-archive.mozilla.org/directory/csdk-docs/example.htm

# include <stdio.h> 
# include "ldap.h"
int main( int argc, char **argv ) 
{ 
   LDAP *ld; 

   int rc; 
   /* Get a handle to an LDAP connection. */ 
   if ( (ld = ldap_init( "ipaddr", port )) == NULL ) { 
     perror( "ldap_init" ); 
     return( 1 ); 
   } 
   /* Bind anonymously to the LDAP server. */ 
   rc = ldap_simple_bind_s( ld, "user@mydomain.com", "***" ); 
   if ( rc != LDAP_SUCCESS ) { 
     fprintf(stderr, "ldap_simple_bind_s: %s\n", ldap_err2string(rc)); 
     return( 1 ); 
   } 
   else
   {
     printf("Successful authentication");
   }
}

我没有了ldap.h头文件。我试图从OpenLDAP的(v2.4.35)和解压包下载到包含头文件的文件夹。我包括在执行过程中该文件夹,发现两个文件丢失lber_types.h和ldap_features.h。我探讨了包,发现lber_types.hin和ldap_features.hin文件。我还发现从lber_types和ldap_features会自动在Linux上配置命令生成的头文件中的互联网信息。我工作在Windows和我现在该怎么办呢?是否有任何其他程序包来执行code?

I dont have the ldap.h header file. I tried to download a package from openldap (v2.4.35) and unzipped to a folder which contained headers. I included this folder during execution and found two files missing lber_types.h and ldap_features.h. I explored the package and found lber_types.hin and ldap_features.hin files. I also found an information from the Internet that lber_types and ldap_features header files are automatically generated by configure command in Linux. I am working in Windows and what should I do now ? Is there any other package to execute the code ?

推荐答案

如果您正在寻找其他选择,比OpenLDAP的Windows上其他。您可以尝试winldap,获取更多信息,您可以访问自己的MSDN页面,也有一些例子也可以帮助你。

If you are looking for other option other than openldap on Windows. You can try winldap, for more info you can visit their msdn page, there are some examples too which can help you.

http://msdn.microsoft.com/en-us/library/windows/desktop/aa367033(v=vs.85).aspx

这篇关于访问使用C的Active Directory的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆