File Handling Utility is developed to perform file functionalities in a simpler way so that most of the manual work can be reduced
Requirements ?H/W Platform: PENTIUM IV ?S/W Environment: WINDOWS XP ?Appln. Type: VB.NET
Features 1.Basic file functionalities like copying a file from one location to another, moving a file from one location to another location, renaming a file by fetching the path, deleting a file from the particular location.
2. Find and Replace gets a word or a letter as input and gets the replacing text as another input. While clicking the replace button the file is opened using the stream Reader and reads the file contents and searches for the text specified in the find. Stream writer replaces the text specified in find with the replacing text and writes into a file
3. Changing the File attributes functionality displays a browser button to get the file name along with the path and displays the attributes like file size, Creation Date and Time of the file. User can change the File access as Read only. The read only property does not allow the user to update any information in the file. Compression of the file can be done by selecting the compression check box and applying the attribute to the selected file.
4. Converting all characters to Upper case or Lower case based on the User needs.
5. Duplication Remover gets the files to be compared as input data and compares the file when the check button I clicked. If the file contents are same it indicates the files are identical and removes the one duplicate file by getting a confirmation message from us.
Summary This tool has been designed so that it reduces most of the manual navigating to the path and making changes in the filenames and file contents
Code for File Copy
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Try
FileCopy(TextBox1.Text, TextBox2.Text & "\" & source.Substring(source.LastIndexOf("\") + 1)) If TextBox2.Text = "" Then MsgBox("Select the Location to Copy") Else MsgBox("File Copied Successfully") Call clear() Me.Hide() Mainform.Show() End If Catch ex1 As IOException MessageBox.Show("Select a different location to copy", ex1.GetType.ToString, MessageBoxButtons.OK, MessageBoxIcon.Information) TextBox2.Text = ""
Catch Ex As Exception MessageBox.Show("File Not Selected", Ex.GetType.ToString, MessageBoxButtons.OK, MessageBoxIcon.Information) End Try
End Sub
Code for File Move
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Try
Dim str1 As String Dim str2 As String
str1 = Path.GetDirectoryName(TextBox1.Text) str2 = Path.GetFullPath(TextBox2.Text)
If str1 = str2 Then MsgBox("Select a different location to move") TextBox2.Text = "" Else
File.Move(TextBox1.Text, TextBox2.Text & "\" & source.Substring(source.LastIndexOf("\") + 1))
MsgBox("File moved successfully") Call clear() Me.Hide() Mainform.Show() End If
Catch ex As Exception MessageBox.Show(ex.Message, ex.GetType.ToString, MessageBoxButtons.OK, MessageBoxIcon.Information) End Try End Sub
|
No responses found. Be the first to respond and make money from revenue sharing program.
|