Grammar
Many people can say that language is just a grammatical difference, in fact, everyone ignores a point to choose a language, the language provider will certainly provide a lot of system library to the language.
The next simple example is to combine JScript.NET and C # to compute an expression.
Problem requirements: Enter a string of simple expressions, output values.
Like 2+4*7, return 30.
Note that we all use. NET to achieve, hehe.
1. Create a new JScript file, Customeval.js
JScript Source Code
Class Customeval
{
static function eval (STREXP)
{
Return eval (STREXP);
}
Then to the. NET command prompt, compile the JS as a. NET assembly
Jsc/t:library Customeval.js
It then generates a CustomEval.dll standard. NET assembly.
The call is also simple.
Creates a new project, references the DLL, and also references MIcrosoft.Jscript.dll
The following code:
Class Program
{
static void Main (string[] args)
{
Console.WriteLine (Customeval.eval ("2+4*7"));
}
}
Oh, the result came out.
Similar to the features you can use C # to provide with many microsoft.visualbasic.*.dll. C # using the characteristics of VB