jscript.net

How to call C# from JScript.net?

拥有回忆 提交于 2019-12-05 01:24:30
问题 I read that, for the newest Java, Javascript on Java can call or import java packages easily. In the newest .NET, can JScript.net call C# functions easily? For details, I am asking not about compiled JScript.net code, but about non-compiled JScript.net string code which is run on the script engine. 回答1: Here is an example: 1) CS file with a simple calls and method that returns a string. 2) js file that calls the CS method using eval. // cstest.cs - compile as library using System; namespace

Get command line arguments with jscript.net

纵饮孤独 提交于 2019-12-04 20:24:08
None of these work: var arguments = System.Environment.GetCommandLineArgs(); ~ var arguments = Environment.GetCommandLineArgs(); ~ var arguments:String[] = System.Environment.GetCommandLineArgs(); ~ var arguments:String[] = Environment.GetCommandLineArgs(); it prints JS1135: Variable 'System' has not been declared or error JS1135: Variable 'Environment' has not been declared . Even in MSDN there's no example with jscript. Is is possible to get the arguments in jscript.net ? This works: import System; var arguments:String[] = Environment.GetCommandLineArgs(); print(arguments[0]); print

List of computers in Active Directory that are online

ぃ、小莉子 提交于 2019-12-04 16:58:00
I'm using this snippet of code to output a list of all the computers on my network (the language is jscript.net, but it's just a small manipulation of C#). var parentEntry = new DirectoryEntry(); parentEntry.Path = "WinNT:"; for(var childEntry in parentEntry.Children) { if(childEntry.SchemaClassName == "Domain") { var parentDomain = new TreeNode(childEntry.Name); this.treeView1.Nodes.Add(parentDomain); var subChildEntry : DirectoryEntry; var subParentEntry = new DirectoryEntry(); subParentEntry.Path = "WinNT://" + childEntry.Name; for(subChildEntry in subParentEntry.Children) { var newNode1 =

How to call C# from JScript.net?

谁都会走 提交于 2019-12-03 16:03:34
I read that, for the newest Java, Javascript on Java can call or import java packages easily. In the newest .NET, can JScript.net call C# functions easily? For details, I am asking not about compiled JScript.net code, but about non-compiled JScript.net string code which is run on the script engine. Here is an example: 1) CS file with a simple calls and method that returns a string. 2) js file that calls the CS method using eval. // cstest.cs - compile as library using System; namespace MyNamespace { public class Foo { public string Bar() { return "Hello JS"; } } } // test.js - compile as exe /

What are people using JScript.Net for?

别说谁变了你拦得住时间么 提交于 2019-11-29 21:00:54
I'm interested to know who uses JScript.Net and for what sort of applications. Whenever I'm reading MSDN .Net documentation, I always notice the JScript samples but in all the years I've been a C# dev I've never actually known anyone to use it. What sort of applications are people using this for, and how does it measure, in terms of flexibility, power and general usage, to C#? [ Edit: Just to clarify - I'm not asking what JScript.Net is , I'm asking what people are actually using it for - i.e. interested to know actual usage scenarios and how people have found it to work with] Rob - I have

Can JScript.NET be used to script a .NET application?

你。 提交于 2019-11-29 09:24:32
问题 Since MS appears to have killed Managed JavaScript in the latest DLR for both server-side (ASP.NET Futures) and client-side (Silverlight), has anyone successfully used non-obsolete APIs to allow scripting of their application objects with JScript.NET and/or can explain how to do so? A Mono/JScript solution might also be acceptable, if it is stable and meets the requriements below. We are interested in upgrading off of a script host which uses the Microsoft JScript engine and ActiveScript APIs

What are people using JScript.Net for?

可紊 提交于 2019-11-28 16:41:07
问题 I'm interested to know who uses JScript.Net and for what sort of applications. Whenever I'm reading MSDN .Net documentation, I always notice the JScript samples but in all the years I've been a C# dev I've never actually known anyone to use it. What sort of applications are people using this for, and how does it measure, in terms of flexibility, power and general usage, to C#? [ Edit: Just to clarify - I'm not asking what JScript.Net is , I'm asking what people are actually using it for - i.e

Focus Next Element In Tab Index

徘徊边缘 提交于 2019-11-26 19:57:55
I am trying to move the focus to the next element in the tab sequence based upon the current element which has focus. Thus far I have not turned up anything in my searches. function OnFocusOut() { var currentElement = $get(currentElementId); // ID set by OnFocusIn currentElementId = ""; currentElement.nextElementByTabIndex.focus(); } Of course the nextElementByTabIndex is the key part for this to work. How do I find the next element in the tab sequence? The solution would need to be based using JScript and not something like JQuery. Brian Glaz Without jquery: First of all, on your tab-able

Focus Next Element In Tab Index

爱⌒轻易说出口 提交于 2019-11-26 07:28:38
问题 I am trying to move the focus to the next element in the tab sequence based upon the current element which has focus. Thus far I have not turned up anything in my searches. function OnFocusOut() { var currentElement = $get(currentElementId); // ID set by OnFocusIn currentElementId = \"\"; currentElement.nextElementByTabIndex.focus(); } Of course the nextElementByTabIndex is the key part for this to work. How do I find the next element in the tab sequence? The solution would need to be based