attached a renamed zip file containing a trivial c# example model that reads data from a file called fileIN.txt during initialisation and writes data to a file called fileOUT.txt during compute. i have commented the bits you need to look out for with '//GRG:', so if you search on that across the engine.cs file you will see what i am doing.
the model omi, xml and input text file are in /bin/data/ and should work without recompiling.
1. please be aware i am not a c# programmer - this works, but may not be a terribly intelligent way of doing things.
2. i would suggest that there are likely to be many different ways of doing this kind of thing, and the attached is only an example to get you going; i would recommend you search msdn, codeproject or another online dev resource to find out what other (and most probably better) ways of doing this exist.
but other than that, i hope this gets you going.
Posted: 13 April 2011 13:52
Subject: How to read data from files and write data to files?
How would you do I/O files for c# projects in FluidEarth?