Private Sub btAddFileTD_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btAddFileTD.Click
'Add File
'---------------------------------------------------------
Dim myFileDlog As New OpenFileDialog()
'look for files in the c drive
myFileDlog.InitialDirectory = "\\172.31.9.106\test_data\PDF-TESTDATA"
'specifies what type of data files to look for
myFileDlog.Filter = "All Files (*.*)|*.*" '& _
'"|PDF (*.pdf)|*.pdf" & _
'"|Excel (*.xls)|*.xls"
'specifies which data type is focused on start up
myFileDlog.FilterIndex = 2
'Gets or sets a value indicating whether the dialog box restores the current directory before closing.
myFileDlog.RestoreDirectory = True
'seperates message outputs for files found or not found
If myFileDlog.ShowDialog() = _
DialogResult.OK Then
If Dir(myFileDlog.FileName) <> "" Then
MsgBox("File Exists: " & _
myFileDlog.FileName, _
MsgBoxStyle.Information)
Else
MsgBox("File Not Found", _
MsgBoxStyle.Critical)
End If
End If
'Adds the file directory to the text box
tbURL.Text = myFileDlog.FileName
Dim str As String = myFileDlog.FileName
Dim s() As String = str.Split("\")
For i As Integer = 0 To UBound(s)
If i = 5 Then
tbData.Text = s(5)
ElseIf i = 6 Then
tbSeries.Text = s(6)
ElseIf i = 7 Then
tbYear.Text = s(7)
ElseIf i = 8 Then
tbModel.Text = s(8)
End If
Next i
End Sub