Debug JScript in C# project

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.

阅读更多
个人分类: .Net
想对作者说点什么? 我来说一句

Demo Code

2008年11月28日 100KB 下载

没有更多推荐了,返回首页

不良信息举报

Debug JScript in C# project

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭