{"id":93,"date":"2008-11-19T12:41:07","date_gmt":"2008-11-19T17:41:07","guid":{"rendered":"http:\/\/hoolihan.net\/blog-tim\/?p=93"},"modified":"2009-06-29T12:09:32","modified_gmt":"2009-06-29T17:09:32","slug":"jscriptnet-and-c-interaction","status":"publish","type":"post","link":"http:\/\/hoolihan.net\/blog-tim\/2008\/11\/19\/jscriptnet-and-c-interaction\/","title":{"rendered":"JScript.Net and C# Interaction"},"content":{"rendered":"<p>\/\/ lib.cs:<\/p>\n<p>using System;<\/p>\n<p>namespace Library {<br \/>\n\u00a0 public class TestLib {<br \/>\n\u00a0\u00a0\u00a0 public static void speak(){<br \/>\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Console.WriteLine(&#8220;Hello From CSharp Dll&#8221;);<br \/>\n\u00a0\u00a0\u00a0 }<br \/>\n\u00a0 }<br \/>\n}<\/p>\n<p>\/\/ hello.js<br \/>\nimport System;<br \/>\nimport Library;<\/p>\n<p>var a = {name:&#8217;JScript Object in Exe&#8217;};<br \/>\na.foo = function (){<br \/>\n\u00a0 Console.WriteLine(&#8216;Hello From &#8216; + this.name);<br \/>\n};<\/p>\n<p>a.foo();<\/p>\n<p>TestLib.speak();<\/p>\n<p>Compiling:<\/p>\n<p>1. Make sure .Net Framework is in your path<\/p>\n<p>2. csc.exe \/t:library lib.cs<\/p>\n<p>3. jsc.exe \/r:lib.dll hello.js<\/p>\n<p>4. hello.exe<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\/\/ lib.cs: using System; namespace Library { \u00a0 public class TestLib { \u00a0\u00a0\u00a0 public static void speak(){ \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Console.WriteLine(&#8220;Hello From CSharp Dll&#8221;); \u00a0\u00a0\u00a0 } \u00a0 } } \/\/ hello.js import System; import Library; var a = {name:&#8217;JScript Object in Exe&#8217;}; a.foo = function (){ \u00a0 Console.WriteLine(&#8216;Hello From &#8216; + this.name); }; a.foo(); TestLib.speak(); Compiling: 1. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[54,34,18],"tags":[41,69],"class_list":["post-93","post","type-post","status-publish","format-standard","hentry","category-javascript","category-microsoft","category-programming","tag-net","tag-linkedin"],"_links":{"self":[{"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/posts\/93","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/comments?post=93"}],"version-history":[{"count":0,"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/posts\/93\/revisions"}],"wp:attachment":[{"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/media?parent=93"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/categories?post=93"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/hoolihan.net\/blog-tim\/wp-json\/wp\/v2\/tags?post=93"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}