aaaahhhhhhhhh copy and pasting and reading and writing in txt documents
-
HEllo, I depretly need someones help, i am using vb.net and have nearly finished a program all i need to do is basically clear data in a txt document after reading it e.g hello.txt i am using
Dim objReader As New System.IO.StreamReader(FILE_NAME)
where i have dimed the FILE_NAME as string ("hello.txt") however i then added
Dim objwriter As New System.IO.Streamwriter(FILE_NAME)
and tried objwriter.writeline("") which then came up with an error message saying file currently in use. Is there no way that you can read the file and then write data into i????? If anybody can help me that would be very good Thanks Dan
-
HEllo, I depretly need someones help, i am using vb.net and have nearly finished a program all i need to do is basically clear data in a txt document after reading it e.g hello.txt i am using
Dim objReader As New System.IO.StreamReader(FILE_NAME)
where i have dimed the FILE_NAME as string ("hello.txt") however i then added
Dim objwriter As New System.IO.Streamwriter(FILE_NAME)
and tried objwriter.writeline("") which then came up with an error message saying file currently in use. Is there no way that you can read the file and then write data into i????? If anybody can help me that would be very good Thanks Dan
-
HEllo, I depretly need someones help, i am using vb.net and have nearly finished a program all i need to do is basically clear data in a txt document after reading it e.g hello.txt i am using
Dim objReader As New System.IO.StreamReader(FILE_NAME)
where i have dimed the FILE_NAME as string ("hello.txt") however i then added
Dim objwriter As New System.IO.Streamwriter(FILE_NAME)
and tried objwriter.writeline("") which then came up with an error message saying file currently in use. Is there no way that you can read the file and then write data into i????? If anybody can help me that would be very good Thanks Dan
you have to close the reader before opening the writer. objReader.Close()