Looking for C# Windows Form to parse and validate a JAVAScript command from a text field.

I am looking for a suggestion on how to parse and validate JAVASCRIPT that was entered into a text field on a windows form.  Is there any build in classes that will do this or is this a 3rd party tool that can added to an application to do this?  Any suggestions?
HojoformoAsked:
Who is Participating?
 
iHadiConnect With a Mentor Commented:
Hi

You can try the method in the following link:

http://madskristensen.net/post/Verify-JavaScript-syntax-using-C.aspx:

public void JavascriptTest()

{

  string[] javascriptFiles = Directory.GetFiles(@"D:\Website", "*.js",
SearchOption.AllDirectories);

 

  using (JavaScriptCompiler compiler = new JavaScriptCompiler())

  {

    compiler.Compile(javascriptFiles);

    Assert.IsFalse(compiler.HasErrors, compiler.ErrorMessage);

  }

}
0
 
HojoformoAuthor Commented:
I need to rephrase this question but it was answered.
0
All Courses

From novice to tech pro — start learning today.