File exists detection

Dec 1, 2012 at 6:59 PM

Hello,

I'm trying to run simple following script (Script is placed in textBox in form) :

            if (System.IO.File.Exists(@"d:\Downloads\vcs_web.exe"))
            {
               return "true"
            }
            else
            {
                return "false""
            };

The file exists on the path, so result should be "true", but result is..."false".

Calling JINT is following :

        private void button1_Click(object sender, EventArgs e)
        {
            var engine = new JintEngine();
            var result = engine.Run(textBox1.Text);

            MessageBox.Show((string)result);
        }

 

Please can someone help me, what I'm doing wrong?...

Thank you

Mar 8, 2013 at 11:29 PM
I bet javascript doesn't need that @ sign in front of the string