[.net] Easy Scripting in .NET

Started by
72 comments, last by ppp_vcf 16 years, 5 months ago
Quote:Original post by GraphicsBas
You should look at the sample provided in the latest DirectX SDK called Scriping. They provide an excellent methode for restricting access of a script.

GBS


Is there any way to get hold of the DirectX SDK Samples without downloading the complete ~500Mb SDK?

//Geron ? ,,,__oOo_(O.O)_oOo__| | | | | | | | || | | | | | | | |
Advertisement
Quote:Original post by Geron
Is there any way to get hold of the DirectX SDK Samples without downloading the complete ~500Mb SDK?

I've zipped a copy of the sample for you. You can download it here.

Its about 5MB(4.875kB) in size. I hope this helps.

GBS
GBS
For those interested here's an example on how to call a script function with parameters:

using Microsoft.CSharp;using System.CodeDom;using System.CodeDom.Compiler;using System.Reflection; ... object[] fParameters = new object[1];int parameter_ = 5;  fParameters[0] = (object)int;CompilerResults results = codeCompiler.CompileAssemblyFromFile(Compile_params, CS_ScriptFile);            if (results.Errors.HasErrors)            {                for (int i = 0; i < results.Errors.Count; i++)                { MessageBox.Show(results.Errors.ErrorText); }            }            object o = results.CompiledAssembly.CreateInstance("MissionScript");            Type t = o.GetType();            MethodInfo mi = t.GetMethod("Start");            mi.Invoke(o, fParameters);

My project`s facebook page is “DreamLand Page”

If you need scripting in your application, try this solutions:

IronPython, IronRuby, or
Script.NET:

http://www.codeplex.com/scriptdotnet

This topic is closed to new replies.

Advertisement