File Problems

  • Thread starter Thread starter Shane Mergy
  • Start date Start date
S

Shane Mergy

Two Problems

1. I know how to read and write to a file however i want
to be able to search a file for a certain keyword and
then append to that file when i find that keyword however
i cannot find a way to read and write to a file unless i
close the file first can you help!!
2. I am writing a class that all can use but i dont know
how i would put it to a namespace so that all can use for
example when i want to create a date time variable i use
DateTime dt = new DateTime
or StreamReader sr = File.Open()
i want to be able to do this with my ini class file so
all can use it
 
Did you try opeining two streams one for reading and another for writing on
the same file?
 
yes i did try that and i get an error saying that the file is used by
some other process
 
I have not done this, but find it in VB help:
1. dim fs = new FileStream("MyFile.txt", FileMode.Open,
FileAccess.ReadWrite)
2a. Dim fs1 = new FileStream("MyFile.txt", FileMode.Open, FileAccess.Read)
2b. Dim fs2 = new FileStream("MyFile.txt", FileMode.Appen, FileAccess.Write)

Probably (1) may not work, as it needs a seek operation which is allowed
only for disk files. I don't know if files on PPC are considered so.

ThanQ...
 
Back
Top