Click here to Skip to main content
15,881,559 members
Everything / Directory

Directory

directory

Great Reads

by Bohdan Stupak
Batching is a nice technique that allows you to handle big amounts of data gracefully. Directory.EnumerateFiles is the API that allows you to organize batch processing for the directory with a large number of files.
by Habibur Rony
This article mainly covers how to setup and configure Azure AD tenant and integrating Azure AD into ASP.NET Core 2.0 web app for authentication and role based authorization.
by Abhijit Shiposkar
Accessing Active Directory Objects via C# (Visual Studio)
by Gil Fink
This tip explains how to perform queries against Active Directory Domain Services

Latest Articles

by Bohdan Stupak
Batching is a nice technique that allows you to handle big amounts of data gracefully. Directory.EnumerateFiles is the API that allows you to organize batch processing for the directory with a large number of files.
by Habibur Rony
This article mainly covers how to setup and configure Azure AD tenant and integrating Azure AD into ASP.NET Core 2.0 web app for authentication and role based authorization.
by Sundeep Kamath
How Resources in Azure can be accessed programmatically using Azure Resource Manager (ARM) APIs
by Sandeep S. Sandhu
Deploy Kerberos on a Raspberry Pi IoT to provide robust and enterprise scalable authentication for IoTs (Part 2)

All Articles

Sort by Score

Directory 

12 Aug 2023 by Bohdan Stupak
Batching is a nice technique that allows you to handle big amounts of data gracefully. Directory.EnumerateFiles is the API that allows you to organize batch processing for the directory with a large number of files.
1 Aug 2018 by Habibur Rony
This article mainly covers how to setup and configure Azure AD tenant and integrating Azure AD into ASP.NET Core 2.0 web app for authentication and role based authorization.
23 May 2012 by Mohammad A Rahman
Directory.Dele...
11 Mar 2011 by Espen Harlinn
I believe you may find this interesting:http://www.boost.org/doc/libs/1_46_0/libs/filesystem/v3/doc/tutorial.html[^] - it will even work on other os'esYou can also usehttp://www.boost.org/doc/libs/1_46_0/libs/regex/doc/html/index.html[^] to facilitate quite advanced search...
13 Mar 2011 by Hans Dietrich
Check out MSDN for FindFirstFile() and FindNextFile().To open a file, you can use ShellExecute(). This will open any file that has a recognized/associated extension.
14 Mar 2011 by Emilio Garavaglia
In addiction to other solution, consider also a better design of your classes, or your code will became a mess.a) You use sometimes string (did you mean std::string ??) sometime character arrays, sometime char*. Be consistent!b) Directories should form a hierarchy. How can you do it with...
31 Mar 2011 by TrustTheMath
Hope this helps -- I'll leave the formatting of the columns to you. I only modified a few lines -- added the"revcol" and "Top" vars to the ShowSubFolders sub to reorder the columns from left to right. (Also added three columnwidth settings for cols B-D just for looks.)Sub ShowSubFolders...
4 Apr 2011 by Jonathan Cardy
Hi!You don't need to create your own dialog. .NET does this work for you, simply display a OpenFileDialog through which the user can select files to copy. See the documentation for OpenFileDialog...
21 Oct 2015 by OriginalGriff
Try:string basePath = Path.Combine(@"C:\Users\user\Desktop\Project\Project1\Test\Test\NewProject\StoreImage, panel.HeaderText);if (!Directory.Exists(basePath) { Directory.CreateDirectory(basePath); }MyImageOfAChart.Save(path.Combine(basePath, "MyFileName.jpg"),...
14 Sep 2010 by aayu
private DirectoryEntry entry; entry = new DirectoryEntry("LDAP://" + oDomainName + "", oUserName, oPassword, System.DirectoryServices.AuthenticationTypes.Secure);private DirectorySearcher ds;entry = new DirectoryEntry("LDAP://" + oDomainName + "", oUserName, ...
9 Feb 2011 by Abhijit Shiposkar
Accessing Active Directory Objects via C# (Visual Studio)
8 Mar 2011 by Amit Kumar Tiwari
Please try code below:/// /// Gets the Visual Studio 2008 installation directory path. /// /// Visual Studio 2008 installation directory path public static string GetVS9InstallDirectory() { ...
8 Mar 2011 by Ryan Zahra
May I add to Amit Kumar Tiwari solution:First you need to check if you're running in x86 or x64. This could be achieved by:System.Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE")Please note that this only works if the variable isn't manipulated!!If the architecture is x86...
24 Mar 2011 by Sergey Alexandrovich Kryukov
In addition to Richard's Answer: there is no such thing as "open file in console". You just open a file, use System::IO::StreamReader as you need just to read it.If you need content comparison at the level of Microsoft Word document, this is a separate issue. Start from here:...
17 Aug 2011 by #realJSOP
You could try checking the DirectoryEntry.SchemaClassName. Users are indicated with a class name of "User". I don't know what the others are (but you should be able to find them on google).
12 Mar 2015 by OriginalGriff
No, the image won't save.When you install an application in production, it is installed in a folder below the "Program Files" or "Program Files (x86)" folded - and by default these folders are all write protected to help reduce the impact of Trojans, viruses, and so forth.So when you try...
15 Jun 2015 by ZurdoDev
Mixed authentication is relatively easy to do. I do suggest searching for examples. I'll briefly explain what I did about 5 years ago.1. Set your web.config to use Forms Authentication. https://msdn.microsoft.com/en-us/library/7t6b43z4(v=vs.140).aspx[^]2. Set the login url to a page...
9 Oct 2015 by Philippe Mori
If you want user to save file in a fixed location, then simply display a form that allows to type a file name.Thus you do code your own form and do whatever you want to do. This could be a lot of work if you want most of the functionnality of common dialogs.In that case, your application...
26 Jun 2018 by Clifford Nelson
I have been using ManagementClass to create shares, and they can be seen in with the "net share" command line and by using the computer's IP's address in Windows Explorer. The problem is if you look at the properties of the folder that is being shared you do not see the sharing information in...
13 Apr 2010 by BryanMac789
Hi all, I am trying to retrieve the "Modified" date attribute from active directory using c#. In the ADUC snap-in GUI application this property is located in the "object" tab. I am using a Directory Search to retrieve the user records, where by "currentUser" below is declared as a...
18 Apr 2010 by BryanMac789
Hi all,Worked out, with the help of the links Rod provided, what the problem was with the "WhenChanged" property. I noticed that the date and time of this property was different when accessing programatically than from the ADUC Snap-in GUI. Basically what was happening was any object...
30 Jun 2010 by Abhishek Sur
Yes, you cant use "Auth_User" or Logon_User to get the appropriate username. You need to search using DirectoryServices.Check this link :http://forums.asp.net/t/1066136.aspx[^]I think this is what exactly you are looking for. :rose:
26 Jul 2010 by Gil Fink
This tip explains how to perform queries against Active Directory Domain Services
6 Jan 2011 by Dave Kreskowiak
In all of those examples, they all connect to a domain controller with a path something like: 'LDAP://DC=fabrikam,DC=com'. You should just have to be more specific and expand that path to include the OU path: 'LDAP://OU=someContainer,DC=fabrikam,DC=com'. Note, using a path like this limits...
13 Mar 2011 by CPallini
programming nerd wrote Directory::GetDirectories("D:\\")This method is for managed code. If you are indeed using CLI/C++ the have a look at the documentation provided code sample: DirectoryInfo.GetDirectories[^].On the other hand, if you're writing native code then check out, as Hans...
24 Mar 2011 by WajihaAhmed
Hello everyone!I am facing trouble in doing containership in c++/cli. I have got two classes. One is a directory class with a data member "System::string^ path" and the other class is "file" with the data member "System::String ^ name".Now the idea is: directory contains a...
24 Mar 2011 by Richard MacCutchan
1. There is not any relationship between your two classes that I can see, although a Directory object may contain File objects.2. You open a file by one of the file or stream methods. If by a doc file you mean a MSWord document then you will need to refer to the Interop assemblies[^] on...
3 Apr 2011 by #realJSOP
The most glaring problem I see is that in your call to the DirectoryEntry constructor, the string parameter has an invalid space in it, namely:"LDAP:// MyDomain"It should be:"LDAP://MyDomain"Second, you may be missing some parameters inside the string. I recommend that you...
8 Apr 2011 by wooga111
Hello All,I am creating a web application that has a database. To log onto that database by impersonating a user with right to the db in the web.config file:This impersonate works correctly and I am able to get to the database with no problems.On page init I need to check to see...
20 Jun 2011 by mfinky
Hi.Is there any way to retrieve the date-time when a specific user joined a specific AD group?Thanks,Marcelo
17 Aug 2011 by Simon Bang Terkildsen
Ahh John seems to be on top of it so forget what I said except for my ad :)AD isn't my strong suit but I beleave you should be able to use the Path poroperty of DirectoryEntry to see if it's a user CN=user should be present, CN=Distribution Groups ect.I know it's again the rules to post...
9 Feb 2012 by RDBurmon
This should workImports System.IOPublic Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim sourcepath As String = "E:\temp\test\1.txt" Dim DestPath As String = "E:\Data\" ...
24 Nov 2021 by LNogueira
Hi,I'm receiving the following error when the computer object has child objects.Unable to delete object:The directory service can perform the requested operation only on a leaf object.My code:Shared Function DeleteMachine(ByVal adPath As String, ByVal domain As String) As...
4 Jun 2012 by Zoltán Zörgő
You can access it wia http://msdn.microsoft.com/en-us/library/system.directoryservices.directoryentry.properties[^] property collection....foreach(SearchResult resEnt in mySearcher.FindAll()){ DirectoryEntry ent = resEnt.GetDirectoryEntry(); Console.WriteLine("{0} created on {0}",...
26 Jun 2012 by Clifford Nelson
You can get the directory size with linq:string path1 = @"C:\Users\cnelson\Documents\Visual Studio 2010\Projects\ConsoleApplication2\ConsoleApplication2";var dir = new DirectoryInfo(path1);long totalsize = dir.GetFiles().Sum(file => file.Length);or do it the old way:string...
10 Aug 2012 by Zac Newman
What needed to happen is that the CN needed to be changed in one function and then that function research the user based on CN before trying to edit any other information.
11 Sep 2012 by Sergey Alexandrovich Kryukov
Please see the comments to the question by Zoltán Zörgő and mine. You did not provide relevant information on what happens. One of the most apparent thing which might happen is this: some executable files in this directory are loaded for execution and are actually executed when you try to...
10 Sep 2013 by Joezer BH
Use DirectoryInfo's GetDirectories to get a list of directoriesHere's a simple example:// Make a reference to a directory.DirectoryInfo di = new DirectoryInfo(@"c:\");// Get a reference to each directory in that directory.DirectoryInfo[] diArr = di.GetDirectories();// Display...
15 Sep 2013 by TheUltimateDebugger
Check the discussionDetecting an opening folder on C#[^]
11 Oct 2013 by ASP.NET Community
The Global.asax file, also known as the ASP.NET application file, is an optional file that contains code for responding to application-level and
16 Sep 2014 by Manas Bhardwaj
I think what you need is an Application Page:http://msdn.microsoft.com/en-us/library/ee231581.aspx[^]Quote:An application page is an ASP.NET Web page that is designed for use in a SharePoint Web site. Application pages are a specialized type of ASP.NET page. The primary difference...
12 Dec 2014 by TheRealSteveJudge
If you use a debugger it says: The given path's format is not supported.bugun is 12.12.2014 00:00:00So you are trying to create a path called c:\data\12.12.2014 00:00:00':' is not allowed in a path name.Change the format of your date e.g.:string bugun =...
2 Jun 2015 by Sergey Alexandrovich Kryukov
Your list items should be the full names of the infected files. You don't have to show the full names in UI. To achieve that, you can create an item class (or struct) with all item information you need for your work and override System.Object.ToString. You will find more detail in my past...
17 Jul 2017 by Richard MacCutchan
Please stop reposting this question. You have received a number of suggestions already. If you really cannot solve such a basic issue then you should go back to your study guides and do some serious reading.
21 Sep 2018 by Richard Deeming
Try PasswordLastSet instead of PwdLastSet. As far as I can see, there isn't a PwdAge property; you'll need to calculate it from the PasswordLastSet property. Something like this should work: Search-ADAccount -AccountInactive -TimeSpan 90 -UsersOnly -SearchBase "OU=User...
11 Dec 2018 by Afzaal Ahmad Zeeshan
Quote: I need to search one directory (c:\K_txt) of almost 3,000 .txt files Searching this on the fly is a really very bad idea, and would have to make your users wait each time they make a change in the query. A good approach would be to read your files once, and create tokens (words, in...
18 Feb 2010 by Mehul M Thakkar
Hi,I need to develop web base extranet(internet) application with Active Directory. Is there any way to avoid login screen in application with the use of SSO with Active Directory?I read about to implement in intranet application with windows authentication. That is fine because the...
19 Feb 2010 by Alaric Dailey
Theoretically its possible, you could connect over an exposed port (preferably over SSL) to query it. But there are better solutions out there.OpenID, OAuth, and WCF authenticationDotNetOpenAuth implements OpenID and OAuth for .NET
1 Mar 2010 by Nima.naqipoor
In win app ,I wanna show the delete action like log ;for example when user delete a folder in drive d: , the application shows this info in the lable.text :>Please gimme a clear solution:rose:
1 Mar 2010 by Kristian Sixhøj
Have a look at the FileSystemWatcher[^] component from the toolbox.
20 Mar 2010 by kingskunal
I am trying to create a directory on ftp server using asp.net (c#)Please reply how to omplement it
20 Mar 2010 by Not Active
Try looking here[^]
22 Mar 2010 by silentdeepa
Hi,I need to access Active Directory that resides on Windows 2003 server from an ASPX application that is hosted on another Windows 2003 server. I code works fine if both the Active Directory and ASPX application are on same server. But I get "The server is not operational" error when...
24 Mar 2010 by RCoate
Have you tried serverless binding?Instead of:silentdeepa wrote:LDAP://FullyQualifiedServerName/OU=Users, OU=NPP,DC=example,DC=myserver,DC=inUse:LDAP://domain.com/DC=domain,DC=com,OU=Users,OU=NPP,DC=example,DC=myserver,DC=in(you may also need to put in...
3 May 2010 by alessandro.campagna
Hi All, I got a Login page, using the .net login control that work correctly on my intranet network.
30 Jun 2010 by DeepToot
I seem to be having an issue getting the username of the user visiting my site. This is an intranet site and will be cross domain. What I need to do is authenticate the user in Active Directory. I know how to do this in Active Directory but what I can't do is get the username that I want to...
22 Jul 2010 by Member 1544087
Hi,I am having 2 AD. While running my script I will be providing userid to one of the AD and getting the required user data. Then using all that data, I will be creating new user in other AD.If I run my script from same AD itself then it is working fine but when I am running it from some...
23 Jul 2010 by E.F. Nijboer
Most of the time the LDAP connection isn't okay. You could always try a public LDAP server for testing the code.http://www.emailman.com/ldap/public.html[^]http://www.keutel.de/directory/public_ldap_servers.html[^]Good luck!
14 Sep 2010 by orenbak
Hi,I need to authenticate a lotus notes user from my C# code.I am using DirectoryEntry to authenticate a user against Active Directory and it works fine, but when I do the same against Domino server I am always getting a valid "Name" field (Even for wrong password).Can you help?Thanks!!!
20 Oct 2010 by Dylan Morley
Possibly have a look herehttp://www-01.ibm.com/support/docview.wss?rs=463&context=SSKTMJ&dc=DB520&dc=DB560&uid=swg21270777&loc=en_US&cs=UTF-8&lang=en&rss=ct463lotu[^]The dominoAccessGroups attribute must be requested specifically from an authenticated user, except when it is added to the...
23 Oct 2010 by DreamCpp
I am working on a project that involves parsing a bunch of xml files in a customizable folder.For sake of saving you several hundred lines of code...Im using MFC on windows XP to build a dialog app, CString is my primary means of storing string data, all global app settings are in a static...
24 Oct 2010 by Richard MacCutchan
I have tried to re-create your problem on Windows 7, and am able to create a new directory, add a file to that directory, and write data into that file. Windows explorer shows the directory as read only but I suspect that this is not absolutely correct. You state that you get crashes in your...
24 Oct 2010 by Nish Nishant
A directory is always treated as read-only (internally it's sorta like a read-only file entry if you think of it). As Richard hinted already, your error is somewhere else.
21 Dec 2010 by cjrowell74
Ok so this whole Java thing is a still new to me and I am trying to learn it by building myself something to list all the folders and subfolders i have in my music collection (this is a lot)I have the following code done so far and it loops through and lists the top level repeatly about 10...
6 Jan 2011 by chris.noga
Hi Everyone,I'm working on a program that needs to read a list of PC's from Active Directory a few levels down in the OU structure.The AD path I would need to access is this:company.com - Divison1 - Site1 - ComputersDivision 1, Site1 and Computers are all OUs.Problem is any...
22 Feb 2011 by Member 3568076
Hi,How to list all users in ListBox include cn, mobile, mail?private void Form1_Load(object sender, EventArgs e){ DirectoryEntry dir = new DirectoryEntry("LDAP://ou=o,DC=xyz,DC=de"); DirectorySearcher search = new DirectorySearcher(dir); search.Filter =...
8 Mar 2011 by Apfelmuuus
I use msbuild to build some projects and have to invoke msdev.exe (Visual Studio 6) to build older projects. Since there is a need to use the msbuild-project on different computers I have to get the installdirectory of Visual Studio 6 each or something else.Thanks in advance for any help.
8 Mar 2011 by Apfelmuuus
All right I got it!I just changed.RegistryKey regKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\VisualStudio\9.0\Setup\VS"); vsInstallationPath = regKey.GetValue("ProductDir").ToString();to:RegistryKey regKey =...
12 Mar 2011 by OriginalGriff
Where do I start?Error 1: "b" is not a pointer. "b" is an array of pointers to strings. To access an individual string, you need to derefence it. Try "b[0]->get_length()" instead. It won't work, beacuse there is a good chance you need to add another loop, but hey! It's your logic.Error 2:...
28 Mar 2011 by GedSmith
I have tried to write a vb script to get the folder structure of a directory (and sub folders) and output the structure to excel. I can do it in a list form but would like the directory tree indented in excel so you can see the folder hierarchy.Here is my code so far:Sub...
3 Apr 2011 by farzane2009
Hi . Az you know every user that is defined in active directory has FirstName,LastName ,UserLoginName(sAMAccountName),Email,.... now i have FirstName+LastName of any users on my local network and i want to get UserLoginName of any users from server's active directory.what can i do?? and here my...
8 Apr 2011 by Ramu Sangabathula Original
Not sure, I have created a sample with impersonation and checked whether the signed in user belong to a role or not, and without impersanation also, both gave me positive results. Not sure why you are facing the issue. can you send me your code to repro. But if you want to connect to database...
17 Apr 2011 by WajihaAhmed
Finally I completed the short project.To get the list of files and sub directories, I made use of .NET Framework namespace "System".It has got classes like "FileInfo" and "DirectoryInfo"(both belong to System::IO) which do the above required task.But here,all the string related stuff is of...
28 Apr 2011 by Ir-win ChakadCo
Download the source code -423 KBIntroduction:Today I put a sample program to manage your FTP Perhaps all of you with many programs to work with FTP or have seen much of you need to have transferred the file to the server or servers to receive and manage the server. It can create...
28 Apr 2011 by Deepthi Aravind
Syntaxmkdi...
30 Apr 2011 by cheekycroak
Dear all..before i give up after multiple trial and error attempts,can someone please help me with below query.I am trying to replace the path name D:\Downloads\Music\ (note the slash) to http://mysite.com/Music/ in mysql field name called "filename" under "songlist" table.Below is the...
30 Apr 2011 by Abhinav S
Try putting @ before your text string paths.
1 May 2011 by Costica U
Shouldn't be single quote(') instead of double quote(")?
25 May 2011 by swbo102
I am using system.directoryservices.accountmanagement in C# to update fields in active directory and what I need to do within this namespace is to move a user from one Organizational Unit to another. I know how to add and remove a user from a group, but I haven't been able to find how to move...
25 May 2011 by Marc A. Brown
Does this[^] article help? There's a bit in there about moving an object from one location to another that might be of interest.
3 Jun 2011 by Anshul R
Use the Shell or its equivalent and execute this : net user "[username]" *Replace [username] with the actual username.Then use SendKeys.SendWait to send the new password, send a return, password again and return.
8 Jun 2011 by funniezatee
Hi everyone,I have sort of found my own answer while looking at functions.php filefrom other templates.What worked for me was I shifted any global variables in my external scriptout into the main functions.php file. I also shifted any functions from my script into functions.php....
20 Jun 2011 by dasblinkenlight
I do not think that there is a direct way to get to this information. We used to work around this problem by participating in AD's RPC Replication, and storing the history in the database. Essentially, our program periodically polled the actual AD for the "deltas", filtered out the changes that...
24 Jul 2011 by KhanImranKhan
Hello MembersHow to search files in a password procteced folder on a remote machine ? I've the server IP and userid/password to access the folder but how to authenticate programmatically.Thanks
24 Jul 2011 by Prerak Patel
You need to use NetworkCredential[^].
25 Jul 2011 by Dave Kreskowiak
That depends on the server you're talking about and how you have to access it. You kind of left those little, but very important details, out of your question.
17 Aug 2011 by nagendrathecoder
Hi all,How can i check whether an entry in ActiveDirectory is a User, a SecurityGroup or a DistributionGroup.Thanks,Nagendra
7 Nov 2011 by lilyNaz
Hi,I need to get the path of all directories which are opened by the user so that I can get all the files and subdirectories which the user may wnat to open and scan them. Can anybody help?Thanks alot.
7 Nov 2011 by epanjohura
http://www.cplusplus.com/[]
7 Nov 2011 by Andrew Brock
Depending on what you are wanting to do, a shell extension[^] may be the best thing. This will integrate your code directly into Windows Explorer, and allow you to do things such as add a toolbar or a column to the file view.If you just want to know what they are looking at, without changing...
7 Dec 2011 by Joe Leibowitz
Use PowerShell to Query and Display Data II (Active Directory\LDAP)
15 Dec 2011 by payne173
Can anybody please let me know whether v hav any api to retreive rsop data on a domain using c#
15 Dec 2011 by Member 3691628
Hi AllI am using windows 2008 R2 Server and trying to Add a user in active directory. I am able to save user ID of length less than 20 Characters. But when I am trying to increase this value to 30 characters then I am getting the error....
19 Jan 2012 by Cool Cassis
You can use the GPRsop class which ships with GPMC/RSAT.Simply add a reference to the Microsoft.GroupPolicy.dll.Here's a link to MSDN:http://msdn.microsoft.com/en-us/library/microsoft.grouppolicy.gprsop_members(v=vs.85).aspx[^]Otherwise you must use the WMI root\RSOP...
29 Jan 2012 by pradip_ssd
HI I am currently working in active directory . I have one computer connected to theactive directory . I am able to get the user connected to that Computer but not able to get the last account modify date of a particular user account.Please help.Thanks in Advance
29 Jan 2012 by Rajesh Anuhya
Go through the below linksHowto: (Almost) Everything In Active Directory via C#[^]Here[^]Thanks--RA
1 Feb 2012 by Member 3691628
Hi All, Please if anyone can suggest me how can I move the Username from sAMAccountName field to user-Principal-Name field in active directory. I have created more than 1000 of user in active directory and used sAMAccountName field for Username but due to sAMAccountName length 20...
17 Feb 2012 by thowra
Hi,I'm trying to replicate some active directory information between an AD server and a third party database of user profiles. The process runs overnight and while I can just get all information for all accounts and update the target database, ideally, I only want to update the accounts that...
6 Mar 2012 by walterhevedeich
Searching in google gave me this[^]. Its written on C# though.