I'm currently in the process of writing a C # application, which is going to be between two existing applications. All I know about the second application is that it processes the files generated by the first. The first application is written in Cobol.
Steps: 1) Cobol application, writes some files and copies to the directory. 2) The second application selects these files and processes them.
My C # application will be between 1) 2). He will have to collect the file generated 1), read it, modify and save, so that the application 2) would not know that I was even there.
I have a few issues.
- First of all, if I open the file generated by 1) in notepad, most of them are unreadable, and the other parts.
- If I read the file, modify it and save it, I have to save the file with the same notation as used by the cobol application, so application 2) does not know that I was there.
I tried reading the file this way, but it still cannot be read:
the code:
string ss = @"filename";
using (FileStream fs = new FileStream(ss, FileMode.Open))
{
StreamReader sr = new StreamReader(fs);
string gg = sr.ReadToEnd();
}
Also, if I find a way to make it readable (using some kind of coding technique), I'm afraid that when I save the file again, I can change its original format.
Any thoughts? Suggestions?
source
share