VS 2008 - List All Sub Directories Names But Only 1 Level Deep?
Mar 13, 2010
I have a button ad a list box, the button when clicked lets the user select a directory on the HDD, and then the app is meant to list all the sub directory's of that folder int he list box. However I cant seem to get it to list just the sub directory names, not the full paths, and also to only scan by 1 folder deep (selected foldersub folder).
I'm having some trouble with list boxes at the moment. I need a list box to display the names of directories that are in certain a folder. How can I do this?
If I have a generic.list(of ClassA), is there a simple way to create a deep copy of this list that will not affect the original copy? It seems to work if I have a generic list of Structures, but for some reason the copy constructor for lists of classes only copies pointers to the elements (or maybe a pointer to the whole list?). I would move to structures if it were not for the fact that I can't find a way to edit the members in the structs in the list. eg:list(0).a = 5 'Does not workIs there some way to get around this without declaring an instance of that structure, like this:dim str as StructA = list(0)str.a = 5I'd
I have several groups of files with idential names, but the files inside may or may not have identcal names, and may differ only in the size or date stamp. I want to combine them to save all unique directory names, and unique file names, and if the date/sizes are unique, then add some number on the end of the file name to make them unique as well. Only idential file sizes and names and dates will be discarded. How do you open directories to compare directory/file names and other properties?
How can i add an array on names in a list box And be able to add and delet name in a listbox ps sence i just fond out .net cant mke control array ill use listbox with an array of names in it
I am trying to get the list of all the SQL Server names. Using the below code I got the name, but actually my server name is OWNER8SQLEXPRESS and I am getting only OWNER8. How I will get the full name.
vb.net Private Sub frmGetServerName_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim dT As DataTable = Sql.SqlDataSourceEnumerator.Instance.GetDataSources() DataGridView1.DataSource = dT End Sub
I'm trying to make a simple program to list a directory and sub directories on an ftp. I haven't found anything simple to do this other than a dll made for ftp commands. There are two problems with that dll, the first is I can't get recursing through directories to work right and it has a trial period. So I'm wondering if there is a simple pure VB way to simply list directories on an ftp. The dll I've played with is ChilkatDotNet2.dll.
I'm learning VB and having a few problems with getting a list of all folders/directories on the system. I'm using the code included here and it seems to work until it hits the recycle bin folder, and some other system folders..[code]
I am trying to create a list of all virtual directories within an IIS site. However, I have found that trying to do this varies dramatically in the older versions of IIS. In IIS 7 this is a relatively easy task via C# but I can't seem to find a good method for doing this in IIS 6 and 5. I have tried using the System.DirectoryServices.DirectoryEntry but that doesn't seem to give me the desired output. I am the server administrator so I'm open to using other things such as .vbs files that are built into IIS as well as writing my own code.
I am trying to Add the name of every folder in a directory to a combobox as a string to use in other code. Then I would like to truncate the last 3 characters off of the folder names.Example:
My main directory is C:Main My sub folders are C:MainsubOne_bp C:MainsubTwo_bp C:MainsubThree_bp
I want a combo box with the following added durring run time.
subOne subTwo subThree
The following code will get me the folder names in the combo box, BUT it will not truncate the _bp off of the end and they are added as IO.DirectoryInfo that cannot be used as a string in other tasks.
Dim dir As String = "C:Main" If (System.IO.Directory.Exists(dir)) Then Dim di_dir As New IO.DirectoryInfo(dir)
I am writing in VB.net to fetch all the directory names (including sub directories in all the levels).However while using directory.getfilesystementries(path) I am getting only the top level sub directories.how to fetch all the subdirectory names of all sub levels?
I am trying to list directories in decending order by directory name. They are still being listed in accending order. Can someone please help me fix the below code as I can't seem to get it working correctly.I am not getting an error with the below code, its showing the list in accending order by name.
Dim oDirInfo As New DirectoryInfo(Server.MapPath("Test/" & Session("Test")) & sSubDir) Dim oDirs As DirectoryInfo() = oDirInfo.GetDirectories() For Each oDir As DirectoryInfo In oDirs oDir.GetDirectories().OrderByDescending(Function(eachDir) eachDir.Name).FirstOrDefault() Try
IIS7 running on Windows Server 2008 R2. Development environment is VWDE 2010.
I'm setting up a simple "machine status" page to monitor a server. I want to display the Drives on the machine, including mapped network drives and show their free space, etc.
I'm using System.IO.DriveInfo.GetDrives() to return a collection of DriveInfo objects. I then itterate that collection to display the relevant information.
The issue I'm having is that only local drives appear. (A:, C: and D:) No mapped drives "Network Locations" appear in the collection.
I'm thinking it has to do with the user account that's executing the code (if that makes any sense). So if the code is executing under the user "ASPNET" (or whatever it is) the drives would have to be mapped under that user. As it happens, I have the server set up like a workstation and it logs in automatically under the user with the mapped drives.
What I've done:
- I have set the Web Site's Anonymous Authentication user to that same user
- I have set the Identity of the Application Pool to which my web site is assigned to be that same user.
im been messing with media player in my app. Great little feature Problem: I have a list of directories in an array. when a user double clicks a treenode in my treeview, i use this directory and add the correct extension to play the file. It works fine but when i click the 2nd node the media player plays the 1st movie again. My question is do i have to clear the media players memory (URL) in order to play my 2nd file?
I am used to C like languages such as C#. I added a list box with a list of names. In the code behind I added the below code. When I run the code I am getting the MessageBox but it will state "UserName favorite color is " but does not show the color. I thought it might be misspelled or non-matching names but this is not the issue due to the names being correct.
Public Class Form1
Private Sub lstData_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstData.SelectedIndexChanged
Dim fileList As Collections.ObjectModel.ReadOnlyCollection(Of String) = My.Computer.FileSystem.GetFiles(FolderDialog1.SelectedPath, FileIO.SearchOption.SearchTopLevelOnly) For Each topLvlFile As String In fileList
[code]....
The above code reads all the files & directories in a selected path. It ignores any hidden folders, like it suppose to. Except it doesn't ignore folders inside of the hidden folders that it finds & I need it to.I can't quite wrap my head around how to make it ignore all folders & files inside of a hidden folder that it find.
I'm developing a software for my community library, so I'm searching for a VisualBasic.Net code to achieve the following objectives...
1. Get a list of all top windows displayed on a computer...?
2. how would I retrieve the images of these windows...?
basically the scope of the project is to be able to monitor client activity on the library's client computer systems such as being able to tell how many windows are currently displayed on a client's computer and if possible retrieve thumbnail images of the windows...since the library is hooked up to the internet, the software intends to block use of file sharing sites, and pornography. It is easy to block unwanted sites with certain software, that is if you know what site to block, sadly the list of malicious sites is growing daily... so visual monitoring is required...
The first list box contains the project name. Based on whatever is selected in the Projects list box, the 2nd list box is generated with Custodian names associated with that project. I am having problems generating the 3rd list box. This holds the data sources associated with whatever is selected in the 2nd list box (Custodians)
I just need to know where my code is jacked -up at, I get an error when I created the module level variable ( class statement must end with a matching end class) problem is that every time I add an end class the next procedure is wrong with the same error, so what can I do to resolve this and why is this error coming up. Ultimate goal of this program is to add the invoice totals to the next element in the array each time the user clicks calculate, which displays in a message when the user clicks the exit button, also this code will sort the invoice totals in the array.
Public Class frmInvoiceTotal Dim SumInvoice(4) As Decimal 'Delareation of two module- level variables Dim I As Integer = 0' the index I can use to work with this array Private Sub btnCalculate_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles btnCalculate.Click [Code] .....
I am using the following to poulate a list box with the file names in a certain directory...lstImages.DataSource = IO.Directory.GetFiles("C:UsersLBDesktopSTRImagesPumps")This works, and does populate the list box, but it shows the full path on each line...
how to list names from a file, as you enter (spell) the name. eg if you enter 'b' all 'b' names will appear. If you next enter 'e' then all 'be' names will appear. repeating this until the last letters are entered. eg 'bell' will show all names starting with 'bell'. You can then select from the list the correct name?