Hi,
I am somewhat beginner in coding, so please excuse me, if my question is easier.
I wrote an application, to read a text file which includes some variables, like this:
I used the following code:
The result is not what I would like to be:
This is what I would like to get
Is there any kind of solution, using the Eval function?
Thanks. Appreciate any aswers.
I am somewhat beginner in coding, so please excuse me, if my question is easier.
I wrote an application, to read a text file which includes some variables, like this:
"Text1" + var1 + "Text2"
"Text3" + var2 + "Text4"
"Text5" + var3 + "Text6"
I used the following code:
MSScriptControl.ScriptControl sc = new MSScriptControl.ScriptControl();
sc.Language = "VBSCRIPT";
string strAppDir = System.IO.Directory.GetCurrentDirectory();
string strFile = "TextFile.txt";
string tmpFile = Path.Combine(strAppDir, strFile);
string tmpText = File.ReadAllText(tmpFile);
string var1 = "string01";
string var2 = "string02";
string var3 = "string03";
Object result = sc.Eval(tmpText);
MessageBox.Show(result.ToString());
The result is not what I would like to be:
This is what I get in result.Text1Text2
Text3Text4
Text5Text6
This is what I would like to get
The variables are not included in the result.Text1String01Text2
Text3String02Text4
Text5String03Text6
Is there any kind of solution, using the Eval function?
Thanks. Appreciate any aswers.