关闭

Debug JScript in C# project

607人阅读 评论(0) 收藏 举报

Debug Jscript, in C# project. Step by Step

* Create a JScript b.js
class myClass
{
    var answer : int = 42;         // public field
    private var pi : double = Math.PI; // private field
    
    static function sayHello() // public method
    {
  var b = 100;
  b= b+1;
        return "Hello";
    }
}

* build a dll or exe, by VS.Net command
http://msdn.microsoft.com/library/chs/default.asp?url=/library/CHS/jscript7/html/jsoriJScriptCodeWritingCompilingAndDebugging.asp
jsc /debug /target:library b.js

* Create a C# poject. Add reference to Microsoft.JScript and b.dll

* Call class member function defined in b.js.

  private void button1_Click(object sender, System.EventArgs e)
  {
   //myClass b = new myClass();
   //b.sayHello();
   myClass.sayHello();  
  }

* Build and debug. step into the function defined in JScript.

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:43025次
    • 积分:626
    • 等级:
    • 排名:千里之外
    • 原创:20篇
    • 转载:20篇
    • 译文:0篇
    • 评论:1条
    最新评论