Create a TXT file in the VFP Program and add the VFP evaluation result to the TXT file.
Create and delete TXT files (VFP)
Cscore = 'd:/score.txt'
If file (cscore)
Dele file 'd:/a.txt'
X = fcreate ("D:/score.txt ")
= Fputs (x, alltrim (STR (score_all )))
= Fclose (X)
Else
X = fcreate ("D:/score.txt ")
= Fputs (x, alltrim (STR (score_all )))
= Fclose (X)
Endif
Delete file ('d:/score.txt ')
//// C # execute the EXE file and read the results of VFP execution
Static void main (string [] ARGs)
{
// Compile the VF volume determination system into an EXE file and execute
Process proc = new process ();
Proc. startinfo. filename = @ "C: // users/Administrator/desktop/test.exe"; // you can use an absolute path.
Proc. startinfo. Arguments = "";
Proc. Start ();
// Proc. Kill ();
If (system. Io. file. exists ("D: // score.txt "))
{
// C # Read the score File
Streamreader objreader = new streamreader ("D: // score.txt ");
String Sline = "";
Arraylist arrtext = new arraylist ();
While (Sline! = NULL)
{
Sline = objreader. Readline ();
If (Sline! = NULL)
Arrtext. Add (Sline );
}
Objreader. Close ();
// Display the read result
String score = "";
Foreach (string soutput in arrtext)
Score = score + soutput;
// Console. writeline (soutput );
Console. writeline (score );
// Console. Readline ();
}
}