Question: Develop a Visual Basic project with the following features: 1 . The user interface can display the following information, one textbox for one item: 1

Develop a Visual Basic project with the following features:
1. The user interface can display the following information, one textbox for one item:
1b. Title
1c. Source -- where the paper is published
1d. Abstract
2. There is a command button "Import". It would allow the user to select the eric.txt as the input file and save the random file on the disk. With this function, you need to define a data structure for the record in the random file. Do some study to the data in eric.txt and design your own data structure. Save the random file in the same folder as where the exe file is and name the random file as randomefile.txt.
3. When your program starts, it should detect whether databaswe.txt exist. If the file already exists, the Import button should be disabled, and your program should automatically open the random access file created in step 2.
4. There is a Next button and a Previous button. When the first record is being displayed, the Previous button should be disabled. When the last record is displayed, the next button should be disabled.
Hint: title and abstract may take multiple lines in eric.txt.
Use this code I provided and just add on it so it could read the title , source and abstract from Eric.txt
Text boxes below
title=txttitle
source=txtsource
abstract=txtabstract
Buttons
Next button
Previous button
Public Class Form1
Private Sub Btnread_Click(sender As Object, e As EventArgs) Handles Btnread.Click
Dim OpenFileDialog1 As New OpenFileDialog
OpenFileDialog1.ShowDialog()
Dim cat As eric
FileOpen(1, OpenFileDialog1.FileName, OpenMode.Input)
FileOpen(2, "random.txt", OpenMode.Random, RecordLength:=Len(cat))
Dim oneline As String
Dim recno As Integer
recno =1
Do While (Not EOF(1))
oneline = LineInput(1)
If oneline.Length >10 Then
If (Mid(oneline,1,10)= "Authors: ") Then
cat.author = oneline.Substring(10)
End If
If (Mid(oneline,1,11)= "Pub.Date: ") Then
oneline = oneline.Substring(11)
cat.year = Val(oneline)
FilePut(2, cat, recno)
recno = recno +1
End If
End If
Loop
FileClose(1)
FileClose(2)
End Sub
Private Sub Form1_DoubleClick(sender As Object, e As EventArgs) Handles Me.DoubleClick
Dim cat As eric
FileOpen(2, "random.txt", OpenMode.Random, RecordLength:=Len(cat))
FileGet(2, cat, 1)
txtauthor.Text = cat.author
txtyear.Text = Str(cat.year)
FileClose(2)
End Sub
End Class

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!