Question Random file access

pumper

Member
Joined
May 12, 2016
Messages
14
Programming Experience
1-3
I am new to C# programing. I have been using visual basic.
and when I access my file I use: FileOpen, FileGet FilePut and FileClose features of visual basic.

What would be similar in C#?
 
I have attached MyData Project. I did not delete the bin and object folders for fear for deleting the wrong thing.
I don't see any attachments on any of your posts.
Also it's forum rules to delete the bin & obj folders (one of the rules is compiled files, ie exe and/or dll files) of which that's all those two folders holds is the compiled project files, everything else is the source code files that we need & VS creates the bin & obj folders again on first run.
If you attach your zipped project I can take a look at it this evening.
 
From looking into it, while vb6 allowed the program to read/write to a specific block within the Rand file, .Net that idea is a little different in that you'd want to read the entire file into memory and parse it out into a collection of a class that you make that matches the structure of the Rand file's records. Then when done the program takes that collection and writes it all back out to the file.
If your program is the only one using this file, maybe instead of dealing with keeping the data in it you could read the file in, then write the data out as xml which is far easier to work with in .Net and will be more compatible going forward.
 
MyData.zip

I have attached my zip file.

MyData.txt is a shortened data file that has 7 records and no one else uses the file.
The first field of the file is the stored password. Then each record has 3 fields that go into text boxes.
I want to read the password and compare it to what is entered then load the text boxes.
What I show in my program is just reading the password and putting it into textbox3 which is not what I want.

Thanks for your help I just can't get to first base.
 

Attachments

  • MyData.zip
    27.4 KB · Views: 36

Latest posts

Back
Top Bottom