In the next steps, you use the Seek() method to reposition a file pointer so you can access a file from any location. The user will be prompted to enter a number representing a starting point to list the names in the Names.txt file. Names from that point forward will be listed, and then the user will be prompted for another selection. 1. Start a new program named AccessSomeNames that demonstrates how to access requested names from the Names.txt file you created in the CreateNameFile application. Searching a Sequential Text File using System; using static System.Console; using System.IO; class AccessSomeNames { static void Main() { FileStream file = new FileStream("Names.txt", FileMode.Open, FileAccess.Read); StreamReader reader = new StreamReader(file);

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter13: File Input And Output
Section: Chapter Questions
Problem 7PE
icon
Related questions
Question

Using the Seek() Method in C#
In the next steps, you use the Seek() method to reposition a file pointer so you can
access a file from any location. The user will be prompted to enter a number representing
a starting point to list the names in the Names.txt file. Names from that point
forward will be listed, and then the user will be prompted for another selection.
1. Start a new program named AccessSomeNames that demonstrates how
to access requested names from the Names.txt file you created in the
CreateNameFile application.

Searching a Sequential Text File
using System;
using static System.Console;
using System.IO;
class AccessSomeNames
{
static void Main()
{
FileStream file = new FileStream("Names.txt",
FileMode.Open, FileAccess.Read);
StreamReader reader = new StreamReader(file);

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
File Input and Output Operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr