473,387 Members | 1,603 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Jscript Dll with C# program gives Error.

Hi All,

I create Jscript Dll to evaluate string expression in C# program. The
Jscript code :

class JScriptEval
{
function Evaluate(evalString : String)
{
return eval(evalString);
}
}

And compile this Jscript file with the JSC in the .Net to be able to
use it in the C# program.
After that I add the Jscript Dll and Microsoft.Jscrpit dll to the
program as references.
I add button and text box to the form and add this code to the button
click.

private void button1_Click(object sender, System.EventArgs e)
{
ArrayList bb = new ArrayList();
bb.Add("textBox1.Text");
string dd;
int ss;

JScriptEval nn = new JScriptEval();

for(int i = 0 ; i < bb.Count ; i++)
{
dd = (string)bb[i] + ".Length" ;
ss = (int)nn.Evaluate(dd);
}
}

And run the program and then click the button. I get this exception.

"An unhandled exception of type 'System.IO.FileNotFoundException'
occurred in system.windows.forms.dll
Additional information: File or assembly name myeval2, or one of its
dependencies, was not found."

Can anyone help.
Thanks
Bassem
Nov 15 '05 #1
0 1153

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Robert Mark Bram | last post by:
Hi All! I have the following two methods in an asp/jscript page - my problem is that without the update statement there is no error, but with the update statement I get the following error: ...
3
by: Serge Myrand | last post by:
Hi, At the top of my ASP page I declare <%@ Language=VBScript %> what do I have to write to embed some JScript in that page? Do I have to indicate that the code is intended to execute at the...
0
by: bB | last post by:
I am calling an external dll (compiled JScript) from within a try/catch/finally block in a C# program and am unable to catch exceptions being raised in the JScript dll by having a specific...
0
by: Tap | last post by:
I wanted to use the calendar.aspx file that is used by Time Tracker. So I copied the related files. Calendar.* script.js into my local web folder. It gives me the following error on selection...
7
by: RFS666 | last post by:
Hello, I would like to use variables with a type in jscript.NET. I declare them as follows: var x : double = 5.03; This doesn't work in my script, that I write to the page in codebehind with...
1
by: Andrew Wan | last post by:
How can VBScript code access JScript code variables in the same ASP page? <SCRIPT LANGAUGE="VBScript"> Dim a a = 10 </SCRIPT> <SCRIPT LANGUAGE="JScript"> Response.Write(a); </SCRIPT>
1
by: NvrBst | last post by:
Hello. I have a ASP webpage that I'm converting to ASP.NET. The ASP is writen with <%@ Language=JScript %>. I'm having a problem with the 'var oTestObject = Server.CreateObject("Test.class");'...
15
by: zz12 | last post by:
Hello, would anyone be able to confirm that 'jscript.dll' is a necessary file for an .asp page on IIS 5.0 to use the <script language="JavaScipt" runat="SERVER"code? It looks like the code in this...
1
by: pratimapaudel | last post by:
function Showdiv() { var SelectStates = document.getElementById('Select1').value; if(SelectStates ="3") { document.getElementById("div2").style.display = "block"; } else ...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.