473,770 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Show progress bar during the file or folder delete

70 New Member
hi,
i have a windows form and there is a text box to select the file of folder to delete. i need a progress bar during the file of folder deletion.
Mar 28 '07 #1
6 2621
joerozario
60 New Member
in .net 2003 u can see Progressbar control

in .net 205 u can see Progressbar control and StatusStrip

both controls same way of implementing

1. set the maximun value (count the number of files and assigne it as maximun)

progressbar.Max imun =countfiles

2. to increse the progress bar

progressbar.val ue =increment
Mar 28 '07 #2
vanc
211 Recognized Expert New Member
you also have to calculate the whole value of the progress bar to assign the increment variable, get it divided for the number of files and after one file copied you increase this increment.
Mar 29 '07 #3
pankajprakash
70 New Member
you also have to calculate the whole value of the progress bar to assign the increment variable, get it divided for the number of files and after one file copied you increase this increment.

Actually i want to show the progress bar as windows show during the file or folder copying. For that i designed a from with progress bar same as windows show, but i don't know how to implement this.
Mar 29 '07 #4
vijaydiwakar
579 Contributor
Actually i want to show the progress bar as windows show during the file or folder copying. For that i designed a from with progress bar same as windows show, but i don't know how to implement this.
See this can be done with the help of dll and exe communication
make one dll project add one form to it
which contains progress bar
whenevr any file is deleted pass increment value to that progress bar from ur exe
Try it
Good Luck
Mar 29 '07 #5
pankajprakash
70 New Member
i have done the following code for delete files or folders but don't know how to implement the progress bar.


Public Function DeleteFile(ByVa l path As String) As Boolean
'Delete a specified file
Try
If File.Exists(pat h) = True Then
File.Delete(pat h)
Return True
End If
Catch ex As Exception
Throw ex
End Try
End Function

Public Function DeleteFolder(By Val path As String) As Boolean
'Delete a specified folder
Dim objFileInfo As FileInfo
Dim objFolder As DirectoryInfo
Dim objSubFolder As DirectoryInfo
Dim dirInfo As DirectoryInfo = New DirectoryInfo(p ath)
Try
If Directory.Exist s(path) = True Then
objFolder = New DirectoryInfo(p ath)
For Each objFileInfo In objFolder.GetFi les()
objFileInfo.Del ete()
Next
If dirInfo.GetDire ctories.Length = 0 Then
Directory.Delet e(dirInfo.FullN ame)
Return True
Else
For Each objSubFolder In
objFolder.GetDi rectories()
DeleteFolder(ob jSubFolder.Full Name)
Next
End If
DeleteFolder(ob jFolder.FullNam e)
Return True
End If
Catch ex As Exception
Throw ex
End Try
End Function

so plz tell me what should i do.
Mar 29 '07 #6
pankajprakash
70 New Member
Now my problem have been solved.
the code is to delete the folder or file.

Public Function Delete(ByVal path As String) As Boolean
Try
If My.Computer.Fil eSystem.FileExi sts(path) = True Then
My.Computer.Fil eSystem.DeleteF ile(path, FileIO.UIOption .AllDialogs, FileIO.RecycleO ption.DeletePer manently, FileIO.UICancel Option.DoNothin g)
ElseIf My.Computer.Fil eSystem.Directo ryExists(path) = True Then
My.Computer.Fil eSystem.DeleteD irectory(path, FileIO.UIOption .AllDialogs, FileIO.RecycleO ption.DeletePer manently, FileIO.UICancel Option.DoNothin g)
Else
Return False
End If
Return True
Catch ex As Exception
Throw ex
End Try
End Function
Mar 30 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

7
1261
by: Diggler | last post by:
I have a web application that allows a user to manage files on the server. On the page is a counter that tells them how many files are in their folder. When you delete a file from the folder using ASP.NET, it seems to send a command off to delete the file and keeps processing the page... the page reloads, but the file count of the folder doesn't change because it seems that the page rendering is faster than the file deletion. Is there...
7
2538
by: Steve Kallal | last post by:
I have seen this subject tossed around in this forum before. But in my case I need a simple solution. I do NOT need to show progress in terms on percentage complete. But rather I need to show a visual indicator to the user that a process is running. There are two scenarios where I need to show a busy indicator: Scenario #: The first is when posting to the web server and waiting for a response.
3
3829
by: ad | last post by:
I want user can confirm before delete records ? How can I show a confirm dialog when users press a button?
9
8336
by: Paul | last post by:
I'm trying to make get my app to delete all the files in a specified folder and all the files within the folders of the specified folder. e.g. Folder 1 contains three files (File1, File2, File3) and two folders (Subfolder 1, Subfolder 2). .......I need to delete File1, File2, File3. Subfolder 1 contains FileA. .......Need to delete FileA. Subfolder 2 contains FileB, FileC, FileD.
0
1162
by: rohinichandrap | last post by:
Hi, I have a problem with the pdf files in one of my workspaces I am working with.This is during an upgrade from Visual studio 6.0 to Visual Studio .Net 2003. The workspace has two projects A,B. Both the project's .exe,.map,.pdb files are placed in the same release folder. The project setting "Extensions to Delete on clean" under General project settings has .pdb extension also.
3
3463
by: Tim Satterwhite | last post by:
Hi All, I think this is a thorny problem, and I'm hoping you can help. I've not found this exact issue described anywhere yet. I have a stored procedure that calls BULK INSERT on a set of text files. These files are FTP'd from a legacy system (a mainframe running MVS). Sometimes, the process steps on iteslf, whereby the bulk insert is attempted on a file whose FTP is still in progress; it's not fully written to disk on the SQL box...
1
5981
by: Riky | last post by:
hi i have a windows application. I am select the folder or file name from the folderbrowserdialog box and to delete the folder or file i am calling the following code. Public Function DeleteFile(ByVal path As String) As Boolean 'Delete a specified file Try If File.Exists(path) = True Then File.Delete(path)
1
3291
by: Mike P | last post by:
I am trying to apply the Update Progress control to a method that is building a zip file and then giving the user the chance to save the file via a popup box. But the Update Progress control doesn't seem to like this. I am getting the error : 'Sys.WebForms.PageRequestManagerParserErrorException. The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to...
0
1866
by: remya1000 | last post by:
by using FTP i can send files to server using vb.net. if the file is big, then it will take some time to complete the sending process to server.or if we were sending 3-4 files to the server one by one,then whethere we can show the progress of each file sending to server in progress bar. so that the FTP clients can see the progress of file sending to the server. any idea how we can do this to show the progress of each file sending. if we...
0
10254
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10099
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8929
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7451
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5481
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3607
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.