I'm sure I can work out several ways to do this but I wonder if anyone has a neat trick for creating nested folders.For example, if I have a string containing "c:userspauldocsmystuff" I want to create that same folder structure on another drive. I don't want to copy any files, just create the folder structure i.e. "k:userspauldocsmystuff"
at I do not know the number of or the names of the folders, they can be different in different cases, I only have the root path.how I can display folder contents in VB.net and the code worked but couldn't figure out how to create the arrays and display only folders within folders starting with "ad_".
System.IO.DirectoryInfo and System.IO.FileInfo to be used for getting the folders.A literal control can be used to create javascript arrays in ASP.NET. These js arrays can then be used on the client side.
It appears that when IO.Directory.GetFiles tries to read a folder that it doesn't have access to it throws an exception & stops reading. Is there any way to have skip those folders & continue reading the rest of the folders?
i am creating an app that will display the contents of a folder containing hundreds of other folders. these folders are in the following format <Movie.Name>[<Year>]i am trying to create a function that will filter out the years i.e. if i wish to search for movies from 2009 i could use the code 'FilterMovies("2009")' etc... and remove/hide the others.
I am trying to create a new folder in C:\Windows\System32\oobe but I cannot get sufficient privileges. Here is the bit of code that has the error ' I have "CreateDirectory("C:\Windows\System32\oobe\info\backgrounds") in the Form load sub Sub CreateDirectory(ByVal Path As String) Directory.CreateDirectory(Path) End Sub
And then in Form Load I have: Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load CreateDirectory("C:\Windows\System32\oobe\info\backgrounds") End Sub
It keeps saying I don't have the privileges. Is there any way around this? I also need to put files in that folder later on.
I am developing a small tool to allow our Windows admins to do stuff like create/delete users, mailboxes and other useful stuff.The current version has to be launched with RunAs as it requires domain admin privileges to do a lot of the stuff. Now, to overcome this I'm trying to incorporate a dialog box that prompts for credentials when the application starts and then uses said credentials throughout the application. I have it working for the AD interaction but one of the tasks the tool needs to do is create folders on a remote server and share them.Is there any way to create folders using alternate credentials? Maybe, once I have the credentials, quit the application and re-launch it with the specified credentials?
I want to write two nested loops and inside them "two if statements" when I write an Else statement which has a messagebox saying that ID is not found.. it repeated many times depending on the for loops. I only want to be displayed once !!! but when I wrote my code like this (using exit sub), the message appears when the condition is right and appears when the condition is wrong. I tried to move this statement somewhere else but still I have problems with it.
With EMPDataSet For I = 0 To .Personal.Rows.Count - 1 For j = 0 To .Work.Rows.Count - 1 If EMP_CPR = .Personal.Rows(I).Item("CPR") Then txtName.Text = .Personal.Rows(I).Item("Full_Name") [Code] .....
I have a question about using nested IF statements in a SQL query. I have a select statement that calculates a semester grade -- Dim sqlStr As String = "SELECT 'XXX-XX-' + right(socSecNumber,4) As [Student SSN], Round((firstExam + secondExam +(2*finalExam))/4, 0) AS [Semester Average] FROM Grades that I am displaying the results in a datagridview. I can successfully display the masked social security number and the Semester Average but I also need to convert the Semester Average to a letter grade to display in a newly created column for Grade. Can this somehow be done with nested If or Case statements within the SQL statement or is there a way to pass the Semester Average information as a variable to a nested vb If statement? Basically, I am needing to know how to display the letter grade to the datagridview using this criteria:
I'm comparing a temporary table to an another table, to check for changes in the cells. The way I'm doing it, is that I'm using three loops; one to loop trough the temporary, one to loop trough the other table and a last one to loop trough each column. Here's the
vb.net For Each row As DataRowView In View For Each drow As DataRowView In view2
[Code]....
"emitid" is the column I use as a reference to be sure that I'm comparing the correct rows, and the column order will always be the same in both tables.
I use the code below to fill the list box and it works great. But i need it to only look in the \Software and \Software\FolderName Foldername could be any folder in the Software folder i need it to get all the .exe from software folder and only one more folder deep no more.
I need help with file enumeration. I'm trying to create a program that can list files, folders and sub folders locations in a log file for diagnostic purposes. After it searches it can open notepad and display the results. The problem I'm having is that I'm a beginner and not familiar with file enumeration.
I am writing an application that will be used to extract information from any one of three different database applications, depending on the option selected. I would also like it to be possible to run it against one of several environments (e.g. development, test or live).
I plan to hold the relevant logon details (in encrypted form, of course) in the app.config file, with the appropriate details selected depending on the environment and application. Rather than have each option hard-coded into a Select Case statement, I want to be able to nest the variables in the app.config. I had envisaged a section of the config file looking like this:
code For Each item As Reflection.FieldInfo In GetType(NameSpace.ClassWithNestedClasses).GetFields rtfAppend(item.Name & ":" & Tab & item.GetValue(Me)) Next For Each item As Reflection.PropertyInfo In GetType(NameSpace.ClassWithNestedClasses).GetProperties()
[code]...
which gets me the simple string vars and properties of my top class, but how can i apply this to loop through all sub classes and get there vars and props?
I'm working on a program and in it I need to store all combination's of the numbers 1,2,3,4. I would like each combination to be it's own array, and instead of creating 24 different arrays (there are 24 different combinations 1,2,3 and 4 can be arranged) I was wondering if it's possible to create a nested array like so:
That way, I'd be able to reference index 2 of the above array and have the array [1,3,4,2] returned.I looked into multidimensional arrays, but this would require me calling each index of the row and column.I also looked into making a Structure in which there was an array that could hold 4 numbers, but wasn't sure if going that method would be practical or not.
I have an arraylist of a "Doctor" class containing Firstname, Lastname,etc. Some elements in this arraylist may be duplicates of others. I am trying to iterate through the arraylist and search for duplicates. Once i find a duplicate i want BOTH duplicates put into another array and removed from the original array.
here is my function
Public Function createArrayOfDuplicatesAndRemove(ByVal st As ArrayList) Dim duplicates As New ArrayList() Dim i, j As Integer
[code]....
How could something be out of range if i start at the end and work to the front?
I'm gathering a list of files within a directory and then adding them to a ListView:
VB.NET
For Each f In Directory.GetFiles() Dim lvi As New ListViewItem lvi.Text = f.Name
[code]....
The exclusion list works great, but it duplicates each item in the ListView several times. How many depends on how many items that it excludes.
I understand why it's happening, but I can't figure out a way around it. I have to loop through the items in the ArrayList so that I can compare them to the other items.
I'm using a series of nested if/then/else statements to make sure a user enters information into each text box or chooses a radio button. What would i use to say if no text is entered in textbox1, then ... also what would i use to make a sure the user choose one or the other radio button? for example i also have a combo box, i used "If SubjectComboBox.SelectedIndex <> -1" for the if statement.
Have built a project and associated it with a Setup&Deployment Project. The S&D project needs to contain 2 main folders (under User's Desktop) with various formats of files (xmls, txts, dlls) inside them and several subfolders. How can i copy/import these 2 folders and there sub-files/folders into my s&d project?
When adding them in the usual way, they are copied and defined a source path onto the current pc. You can understand what errors this might create when an another targeted pc does not contain those files to the exact location. Is there any way to copy them locally or somehow import them?
i have a program which requires the user to pass it a folder path as the start up argument, i want to add in an association so when a user right clicks on a folder in windows in the context menu is for exampleI know to make associations for file types, and all my associations are added via my app it self not any kind of setup program.
ive been searching round the net but the only examples i can find are for vb6 which i know nothing about, i want to be able to scan a folder and all sub folders with in it and delete any folders which are empty.
This is all the code ive put together so far:
vb Dim folder2scan as string = Folderbrowser.selectedpath If IO.Directory.GetFileSystemEntries(folder2scan).Length = 0 Then End If
This might be crazy but can I (well I know I can do this first part) and create a folder in my Solution Explorer and put classes in there, just so my main form is kept clean, as I only have a couple of forms but there is a lot of code.I thought I would call a class "Panel1_Work" and have all the panel one stuff go there, i.e I have a code which is going to sort a datagridview but i'll write my own function or sub for this as it will be getting called from a few different places.
I'm using the following code to get all of the files from a DVD drive and load them into a bindinglist and then a datagridview:
mAddBL.Clear() ' Try Dim dir As New IO.DirectoryInfo(Form1.m_DVDdrive & ":")
[Code]....
This shows all files and folder names on the disc. If I want it to show all files, regardless of the folder they're in, is there a built-in method to do that or do I need to take an entry, identify it as a directory and then use that as my source to read the files in it?
Well what i want to make is a Programm that loads at every start Folders from a FTP and shows them in a Listbox but i dont know how to make that. Then when somebody Clicks the Folder in the Listbox ist should load all File from the Folder in another Listbox.
I am currently writing an application, where the user clicks a button, it scans for empty folders and then puts them in a listbox.The user can then then select the folders in the listbox and click delete. how to i get the scan button to find the empty folders?
I am trying copying a selected folder and it's contents into a specified location. Now I have managed to be able to copy the contents, into a folder using the code between "With" and the first instance of "Msgbox" with some alterations. I have also, with this current code been able to create the folder with it's name into the specified location, however the contents are not moved as well and I get a empty folder.
Public Class Form1 Private thrdCopyFiles As Threading.Thread Private WithEvents CopyStuff As New CopyFiles Dim AddonPath As String Dim WoWPath As String [Code] ..... I had to replace the first two instances of AddonPath, with AddonName.