I am having a problem trying to delete a file from within VB.NET. Below is the code I have now....
Can somebody tell me why the deletefile is not accepted. I know you can do a savefile or loadfile... How can i set it to delete a file?
Thank you
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Delete Monday Third Shift Job Number
Dim textbox3 As String
If textbox3 = "4535" Then
Dim selecteditem As String = CStr(Me.ComboBox3.SelectedItem)
Dim selectedjobnum As Integer = selecteditem.Substring(selecteditem.IndexOf("#"c) + 1)
Process.Start(String.Format("E:\Job{0}.rtf", selectedjobnum))
RichTextBox2.DeleteFile(String.Format("J:\OperationsGenie\JobsHelp\Monday\ThirdShift\{0}.rtf", selectedjobnum))
Else
MsgBox("You have entered an invalid Code. Please enter the code located is the validation box to proceed.")
End If
End Sub
Can somebody tell me why the deletefile is not accepted. I know you can do a savefile or loadfile... How can i set it to delete a file?
Thank you
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Delete Monday Third Shift Job Number
Dim textbox3 As String
If textbox3 = "4535" Then
Dim selecteditem As String = CStr(Me.ComboBox3.SelectedItem)
Dim selectedjobnum As Integer = selecteditem.Substring(selecteditem.IndexOf("#"c) + 1)
Process.Start(String.Format("E:\Job{0}.rtf", selectedjobnum))
RichTextBox2.DeleteFile(String.Format("J:\OperationsGenie\JobsHelp\Monday\ThirdShift\{0}.rtf", selectedjobnum))
Else
MsgBox("You have entered an invalid Code. Please enter the code located is the validation box to proceed.")
End If
End Sub