How To Clear Existing Folder
Oct 14, 2009
How can I clear an existing folder with vb.net? I already searched the internet, but the code I found only deleted the files and left the subfolders in place. Of course I could delete the folder and immediately recreate it, but in a next stage I want to delete specific files (for instance: .lng files) and leave the other files alone.Perhaps those will be two totally different functions.I recently stopped good old vb6 and the above actions could be done with two look alike functions.
View 6 Replies
ADVERTISEMENT
Mar 26, 2012
I currently have a chart that plots lines of a changing value every time it is called via a timer.
Everything is running as I expected and I am happy, but now I want to be able to press a [STOP] button which will stop the timer and stop the graph from updating, (which I have coded and is now working OK), BUT I then want the code under this [STOP] button to clear everything from the graph, so when I re-start the timer, the graph is cleared and starts plotting fresh points on a clean graph.
The problem I currently have is that when I press the [STOP] button and then press the [START] button, the new lines that get plotted are "added" to the existing lines that are already on the chart, instead of having a new "blank" chart, with no data on it.
So what I am really asking is does anyone know if it is possible to reset a chart clearing everything off it so it is ready to start displaying fresh data?
I was hoping it was something like: "Chart1.Clear" or something simple like that, but I can't seem to find anything that will do it.
View 4 Replies
Jan 22, 2012
I am developing a fairly complex vb.net program with numerous forms, and custom classes, modules, etc. I want to start reorganizing the various folders for components of the program and have a few stupid questions.For one, I find that I cannot take a working executable and move it to a different folder on the same machine and have it work. My program drives numerous slave applications and I would like to group just the executables in a common folder. Do I need to carry additional files along with them to make them 'portable' on my own machine? I haven't discovered how to copy or move an existing project to a new folder. Things seem to blow up because of internal project references etc. Is there some way of copying or duplicating a working project without problems resulting?
View 1 Replies
Jul 6, 2009
im having a problem with replacing some files in a folder, i have made a Auto Upater for a application im making (so beta testers can test it and also get updated stuff to test) now i can replace the Main application.exe with
If File.Exists(Application.StartupPath + "\test.exe") Then
File.Replace(Application.StartupPath + "\update\test.exe", Application.StartupPath + "\test.exe", Application.StartupPath + "\test.exe.old")
End If
This is after i have unziped the main update.zip folder it downloaded
but i also have a Data folder in the Main application folder and inside the new update\Data folder its has updated files now i cant list all files to replace like above as i want be replacing all files all the time, so im looking for something like you have on windows (would you like to replace files) without the prompt its just replaces them, so really im looking for a move and replace without prompting
i have tryed
Directory.Move(Application.StartupPath + "\update\Data", Application.StartupPath + "\Data")
and
Directory.Move(Application.StartupPath + "\update\Data\", Application.StartupPath + "\Data\")
but it errors saying the folder exists and i cant delete the folder as it will have files in that DONT need updating
View 2 Replies
Jun 30, 2011
I have a console application. I get the console application's folder path via this code:
dim Folder as string Folder = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly.Location)
And I need to create a new file with this name Key.txt in the same folder as the console application. Because this file name is rather normal and there is possible duplicate in that folder. How do I prevent duplicate file name while still using simple name for that file?
View 2 Replies
Jan 11, 2012
I'm trying to add a folder and some files within it to a Visual Studio 2010 Express VB.NET project. I have read the answers to questions on this subject here and here. They both say "select folder, right click, and then select Add To Project". But when I right-click in this way, no "Add to Project" option appears. Does anyone know why this is so, and what I can do about it, or alternatively another way of adding a folder to a project?
View 1 Replies
Jan 5, 2009
I need to know How to Clear All Data In "Temporary Internet Files" FolderIs there some code already made for that?
View 16 Replies
Jan 24, 2012
here i am reading files from one root folder and after reading that we are moving that particular file Success folder and taking a copy of that in to back up folder normal
while reading file i will check file naming convention by targeting backup folder if suppose it was exists in backup folder then i m moving the file to duplicate folder
my problem if suppose again same file came to process this file already existed in duplicate folder how do send the file in to duplicate folder, unfornately i dint have any property as file rename
If File.Exists(Swift_Backup + "" + Path.GetFileName(CBFile)) Then
' File.Move(CBFile, Swift_Duplicate + "\" + Path.GetFileName(CBFile)) 'DUPLICATE FOLDER'
[Code]....
View 1 Replies
Dec 13, 2011
this is currently my code to clear my 5 textboxes
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
End Sub
View 16 Replies
May 17, 2009
I have a timer that runs every time by itself, and for the code the runs in it I would like to have it clear the dataset before it does anything, the timer runs every 10 seconds, so I tried to do dataset.clear but it would crash if the dataset had no values
View 4 Replies
Nov 11, 2010
I need to make a program in vb that takes a 1 page existing pdf that i specify and inserts that into another existing pdf that i specify.
View 4 Replies
Jun 23, 2011
in hyper teriminal when i press "ctrl+L" is to clear terminal screen how to write the code in vb.net? Hyperterminal is connecting to serial comport.when i try this it work and return line on debug
serialport.writeline ("at+cmgl=1")
i try this but not work and it still show some lines on debug
serialport.writeline (vbcrtl +"L")
serialport.WriteLine("vbCrLf + l")
View 6 Replies
Sep 20, 2010
way to clear textboxes in VB.Net and what is the difference between the two methods? I have also seen people be critical of folk using clear objects on their forms and i can see why but in this case, i am only learning.
txtbox1.Clear()
or
txtbox1.Text = ""
View 3 Replies
Jul 15, 2009
wan to ask about anyone know the code about how to clear all the data inside the data grid view without clear the binding source...
View 1 Replies
Feb 28, 2011
In my winform program (in vb.net) I wrote:
Dim dt As New DataTable
'Get data from DB into dt
'...
[Code].....
But when I run the program, Clear() cleared both dt and dttemp! Why? Aren't dt and dttemp supposed to be two distinct instances of DataTable?
(I finally found a solution - dttemp = dt.Copy() instead of dttemp = dt. But I still can't see why Copy() was necessary in this case.
View 4 Replies
Mar 26, 2010
I am using the StreamWriter to create a log file for my application. However I do not see a method on how to clear the file (make the file blank again). Also before I clear the file I want to rename it so that I can have multiple log files, a new one produced everytime the application runs.
[Code]...
View 9 Replies
May 13, 2009
I am using Visual Studio 2008 Setup project. I need to copy one folder and the sub folders into the program files but when I tried to copy or add the folder to "Application Folder" in File System editor, I am able to add only files and not folders.
View 1 Replies
Dec 12, 2011
How would I create a dir Inside %temp%? Then extract the file to it and Open a That folder. So far this is my code.
[Code]...
View 5 Replies
Sep 27, 2011
how to change the install folder path in a setup and deployment project/Installer class from program files to C:usersPublic in windows 7 and allusers folder in xp.Want to add MVP with my name.
View 3 Replies
Nov 21, 2010
I installed the new one. I then imported an old project made using vb 2008 EE.I found that a few errors were reported.In the project I addressed some function from a dll called "rsource.dll". I used the following function call:Public Declare Function rs_init Lib "rsource.dll" Alias "init" () As Double.The other different thing is the projevt was developed on a 32 bit OS but since then I have upgraded to 64bit (if this makes any difference). he other thing is where is the debugger PAUSE button. has it been removed from vb 2010?Also when i run debug it seems to create the exe in the Build output target folder instead of the default bindebug folder why is this?
View 5 Replies
Mar 10, 2009
Private Sub Button21_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button21.Click
If TextBox11.Text = "" Then Exit Sub
MkDir(Dir1.Path + "" + TextBox11.Text)
MsgBox("Folder Created:")
TextBox11.Text = ""
End Subok now the file i have is from my.resources.test1 put this file into the folder that wascreated after mkdir line of code i have tried differnt ways of doing it but dose not work. it seams that this whould be so easy i dont if its me getting a mind block or something
View 10 Replies
Mar 15, 2012
Visual Basic 2008/2010 - Save Page As, create a Folder, upload the folder to a specific ftp site I am working on this vb app that will goto a specific site, click on a button(i am still working on the button process) do a save page as, create a folder, save those files to a folder and then upload that folder to a ftp site.
[Code]...
View 2 Replies
Feb 9, 2011
I have the following directory structure in my asp.net webdirectory i want when any body access anypage inside my admin folder then it auto redirect to login page of admin folder until they login
View 1 Replies
Apr 14, 2009
I have made this installation program and everything work just fine, but I wish to improve it a little. Atm. all the files being installed is in a seperate folder, and the installation program simply move them to the right location.There is a builder program too.I would like it to add all files from a list to the programs resource.folder instead of a seperate folder.Atm I add the installation file to the destination folder with the following line. [code]
View 2 Replies
Feb 6, 2010
Code so far:
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
If FolderBrowserDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
End If
End Sub
I have managed to get drag and drop working if this is any help:
Private Sub ListBox1_DragEnter(ByVal sender As Object, ByVal e As _
System.Windows.Forms.DragEventArgs) Handles ListBox1.DragEnter
If e.Data.GetDataPresent(DataFormats.FileDrop) Then
[code]....
View 3 Replies
May 14, 2010
How to add folder to the current users mymusic folder during setup deployment?
View 2 Replies
Oct 28, 2009
I have a question regarding publishing vis ClickOnce. For the publish options, there is a Publishing Folder Location and there is a Installation Folder URL. clarify the difference between Publish and Install, and when it would be apropriate for the two to be different?
View 3 Replies
Feb 3, 2012
I am wanting to get a complete file/folder listing and then copy these files to another folder.
Here is my
[Code]...
This happens on many folders. How can I get a listing of these folders and also copy these files?
View 2 Replies
Sep 30, 2010
I have the following code works fine in Windows 2000, after i moved to Windows Server 2003, it shows "Permission denied"...
View 1 Replies
Aug 23, 2010
So I've been using some code to generate directories and such in a custom treeview, but am looking to expand upon this idea. While it's not using recursive functions, and only calls functions when expanding levels, I'm not quite sure how to put some of these together.find a way to just search through all folders on the PC. If the folder contains audio files, that folder is than added to an array (searching a folder for audio files and adding that folder to an array is done). It's just recursivly searching all folders on the PC.Here is the code I've been using for the treeview (I'm not sure if it can be adapted):
Public Function ListAllDrives() As String()
Dim arDrives() As String
arDrives = Directory.GetLogicalDrives()[code].....
View 4 Replies