Running VBScript and JavaScript from within .NET program.

  • Thread starter Thread starter Gemma M
  • Start date Start date
G

Gemma M

Hi,

I have a C# program which obtains a string from a database containing
VBScript, or JavaScript, or Perl script, and I want C# to be able to run it.

In VB6 (COM), I used MSScriptControl.ScriptControl from scrrun.dll
("Microsoft Scripting Runtime").

Is there an equivalent in C#? Or, will I have to use a PIA on scrrun.dll?

Gem
 
I have a C# program which obtains a string from a database containing
VBScript, or JavaScript, or Perl script, and I want C# to be able to
run it.
In VB6 (COM), I used MSScriptControl.ScriptControl from scrrun.dll
("Microsoft Scripting Runtime").

Is there an equivalent in C#? Or, will I have to use a PIA on
scrrun.dll?



A lot of people do because it is a certianly easier that trying to host the
ActiveX script engines directly.

Google Search
http://groups-beta.google.com/groups?q=MSScriptControl.ScriptControl group:*.dotnet

You could also choose for your .Net app to be a VSA host instead and support
VB.Net and/or JScript.Net scripts. But that's still not as easy as hosting
the ScriptControl (which is msscript.ocx, not scrrun.dll) via interop.

Script Happens .NET
http://msdn.microsoft.com/library/en-us/dnclinic/html/scripting06112001.asp?frame=true

The article was written during the first .Net beta, so details have probably
changed and the sample ScriptPad VSA host probably hasn't been updated. But
it will point you in the right direction.
 
Hi,

Thanks for your help. You're right about hosting VBScripts (and I spotted
my error re : scrrun.dll and msscript.ocx after I had dispatch the
posting... doh!), it is much, much easier than VSA ("Script for The .NET
Framework").

The "Script Happens .NET" article was quite useful (although the down-loaded
example code could have a little more finesse applied, not to mention
commentary!). Also, it led me onto other searches, some of which returned
worrying responses.

It seems there is doubt cast upon the future of "Script for The .NET
Framework". Is it dead (or dying), as some suggest?

Thanks again...
Gem
 
Back
Top