directoryentry

How to know if my DirectoryEntry is really connected to my LDAP directory?

时光怂恿深爱的人放手 提交于 2019-11-30 09:13:09
问题 I'm connecting to a LDAP directory in C#, so I've used the DirectoryEntry class. When you do the "new DirectoryEntry" with address, login, and password it is supposed to connect to the LDAP directory. However, even if the connection didn't work, it returns without problem, and the directoryentry variable is set. So i do i know my connection is really opened ? Right now, I'm using a very very ugly hack : i put a "if(mydirectory.SchemaEntry)" which generates an exception if the connection wasn

How to know if my DirectoryEntry is really connected to my LDAP directory?

我怕爱的太早我们不能终老 提交于 2019-11-29 13:34:34
I'm connecting to a LDAP directory in C#, so I've used the DirectoryEntry class. When you do the "new DirectoryEntry" with address, login, and password it is supposed to connect to the LDAP directory. However, even if the connection didn't work, it returns without problem, and the directoryentry variable is set. So i do i know my connection is really opened ? Right now, I'm using a very very ugly hack : i put a "if(mydirectory.SchemaEntry)" which generates an exception if the connection wasn't etablished, because some of the members of the DirectoryEntry, such as SchemaEntry, aren't set if the

how to iterate over non-English file names in PHP

无人久伴 提交于 2019-11-26 20:46:58
I have a directory which contains several files, many of which has non-english name. I am using PHP in Windows 7. I want to list the filename and their content using PHP. Currently I am using DirectoryIterator and file_get_contents . This works for English files names but not for non-English (chinese) file names. For example, I have filenames like "एक और प्रोब्लेम.eml", "hello 鶨鶖鵨鶣鎹鎣.eml". DirectoryIterator is not able to get the filename using ->getFilename() file_get_contents is also not able to open even if I hard code the filename in its parameter. How can I do it? Artefacto This is not

how to iterate over non-English file names in PHP

我的梦境 提交于 2019-11-26 09:03:17
问题 I have a directory which contains several files, many of which has non-english name. I am using PHP in Windows 7. I want to list the filename and their content using PHP. Currently I am using DirectoryIterator and file_get_contents . This works for English files names but not for non-English (chinese) file names. For example, I have filenames like \"एक और प्रोब्लेम.eml\", \"hello 鶨鶖鵨鶣鎹鎣.eml\". DirectoryIterator is not able to get the filename using ->getFilename() file_get_contents is also