Click here to Skip to main content
15,914,447 members
Home / Discussions / C#
   

C#

 
AnswerRe: reading text file as a database Pin
Nuri Ismail18-Nov-09 5:16
Nuri Ismail18-Nov-09 5:16 
GeneralRe: reading text file as a database Pin
Member 473702218-Nov-09 7:42
Member 473702218-Nov-09 7:42 
GeneralRe: reading text file as a database Pin
Nuri Ismail18-Nov-09 21:09
Nuri Ismail18-Nov-09 21:09 
AnswerRe: reading text file as a database Pin
SilimSayo18-Nov-09 5:33
SilimSayo18-Nov-09 5:33 
AnswerRe: reading text file as a database Pin
PIEBALDconsult18-Nov-09 6:13
mvePIEBALDconsult18-Nov-09 6:13 
GeneralRe: reading text file as a database Pin
Member 473702218-Nov-09 7:17
Member 473702218-Nov-09 7:17 
GeneralRe: reading text file as a database Pin
PIEBALDconsult18-Nov-09 12:07
mvePIEBALDconsult18-Nov-09 12:07 
QuestionGet all users from a group in ad using directorysearcher Pin
caiena18-Nov-09 4:11
caiena18-Nov-09 4:11 
how do i change the filter to only give me users in my group i tryied memberOf='CN=GMDPortal,OU=IT,OU=ADM,DC=corp,DC=com' but it does not work i need to use a directorysearcher because i need to set search.PageSize = 4000; i have 3,000 users in this group

public static ArrayList GetAllADDomainUsers()
{
string domainpath = @"LDAP://DC=corp,DC=com";
ArrayList allusers = new ArrayList();

DirectoryEntry searchRoot = new DirectoryEntry(domainpath);
DirectorySearcher search = new DirectorySearcher(searchRoot);


search.Filter = "(&(objectCategory=person)(objectClass=user)(memberOf='CN=GMDPortal,OU=IT,OU=ADM,DC=corp,DC=com' )(!userAccountControl:1.2.840.113556.1.4.803:=2))";

search.PropertiesToLoad.Add("samaccountname");
search.PropertiesToLoad.Add("distinguishedName");
search.PropertiesToLoad.Add("description");
search.PropertiesToLoad.Add("displayName");
search.PropertiesToLoad.Add("pwdLastSet");
search.PropertiesToLoad.Add("whenChanged");
search.ReferralChasing = ReferralChasingOption.All;
search.PageSize = 4000;
SearchResult result;
SearchResultCollection resultCol = search.FindAll();
user ousr = new user();
if (resultCol != null)
{
for (
int counter = 0; counter < resultCol.Count; counter++)
{
result = resultCol[counter];
if (result.Properties.Contains("distinguishedName"))
{
ousr = new user();
ousr.dn = (string)result.Properties["distinguishedName"][0];
try
{
ousr.Description = (string)result.Properties["description"][0];
}
catch (Exception er)
{
ousr.Description = " ";
}
try
{
ousr.DisplayName = (string)result.Properties["displayName"][0];
}
catch (Exception er)
{
ousr.DisplayName = (string)result.Properties["samaccountname"][0];
}
try
{

ousr.pwdLastSet = DateTime.FromFileTime((Int64)result.Properties["pwdLastSet"][0]);
}
catch (Exception er)
{
ousr.pwdLastSet = DateTime.MinValue;
}
try
{
ousr.whenChanged = (DateTime)result.Properties["whenChanged"][0];
}
catch (Exception er)
{
ousr.whenChanged = DateTime.MinValue;
}
ousr.usersname = (string)result.Properties["samaccountname"][0];
allusers.Add(ousr);
}
}
}
return allusers;
}
}

public class user
{
public string dn;
public string usersname;
public string Description;
public string DisplayName;
public DateTime pwdLastSet;
public DateTime whenChanged;
}
QuestionI did a project on windows in c #.net and when i opened the project after some days it is showing "Could not find type 'CrystalDecisions.Windows.Forms.CrystalReportViewer'. Please make sure that the assembly that contains this type is referenced. If Pin
praveenkumar_vittaboina18-Nov-09 3:35
praveenkumar_vittaboina18-Nov-09 3:35 
AnswerRe: I did a project on windows... Pin
OriginalGriff18-Nov-09 3:55
mveOriginalGriff18-Nov-09 3:55 
Answer. Pin
musefan18-Nov-09 3:56
musefan18-Nov-09 3:56 
AnswerRe: I did a project on windows in c #.net and when i opened the project after some days it is showing "Could not find type 'CrystalDecisions.Windows.Forms.CrystalReportViewer'. Please make sure that the assembly that contains this type is referenced. Pin
Abhishek Sur18-Nov-09 4:48
professionalAbhishek Sur18-Nov-09 4:48 
Questionmultiple webcam capture Pin
mehrdad33318-Nov-09 3:32
mehrdad33318-Nov-09 3:32 
AnswerRe: multiple webcam capture Pin
Richard MacCutchan18-Nov-09 5:09
mveRichard MacCutchan18-Nov-09 5:09 
QuestionSQLite Pin
jashimu18-Nov-09 2:41
jashimu18-Nov-09 2:41 
AnswerRe: SQLite Pin
Eduard Keilholz18-Nov-09 2:45
Eduard Keilholz18-Nov-09 2:45 
GeneralRe: SQLite Pin
jashimu18-Nov-09 2:50
jashimu18-Nov-09 2:50 
GeneralRe: SQLite Pin
Eduard Keilholz18-Nov-09 3:02
Eduard Keilholz18-Nov-09 3:02 
GeneralRe: SQLite Pin
jashimu18-Nov-09 3:10
jashimu18-Nov-09 3:10 
GeneralRe: SQLite Pin
Eduard Keilholz18-Nov-09 3:19
Eduard Keilholz18-Nov-09 3:19 
GeneralRe: SQLite Pin
PIEBALDconsult18-Nov-09 12:47
mvePIEBALDconsult18-Nov-09 12:47 
GeneralRe: SQLite Pin
jashimu18-Nov-09 3:17
jashimu18-Nov-09 3:17 
GeneralRe: SQLite Pin
PIEBALDconsult18-Nov-09 12:45
mvePIEBALDconsult18-Nov-09 12:45 
GeneralRe: SQLite Pin
jashimu19-Nov-09 2:48
jashimu19-Nov-09 2:48 
QuestionConnecting to SQL db from several computers Pin
Chesnokov Yuriy18-Nov-09 0:47
professionalChesnokov Yuriy18-Nov-09 0:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.