Stefan Ram
2015-12-28 05:59:26 UTC
I would like to call a random number method that returns a double.
For certain reasons, I'd like to call a predefined method,
not a method written by me. Otherwise It would be easy.
I thought that the method »random« on this page would fit:
msdn.microsoft.com/en-us/library/41336409(v=vs.94).aspx
. So, I tried to refer to it:
csc /reference:C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.JScript.dll Program.cs
. However, I cannot discover any types from this assembly
(but I do not get an error message either.)
This small program tries to discover the JScript assembly:
public sealed class Program
{ public static void Main()
{ System.Reflection.Assembly[] assemblies =
System.AppDomain.CurrentDomain.GetAssemblies();
foreach( System.Reflection.Assembly assembly in assemblies )
{ System.Console.Out.WriteLine( "Assembly: {0}", assembly );
foreach( System.Type type in assembly.GetExportedTypes())
{ System.Console.Out.WriteLine( "Type: {0}", type ); }}}}
It shows »mscorlib« and »Program«, but I'd also like to see »JScript«.
Assembly: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Type: System.Object
...
Type: System.Math
...
Assembly: Program, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
Type: Program
»System.Math« is there, but not other type with »Math« in
its name.
Can you explain to me what I need to do in order to access
the JScript Math.random() method from my C# program?
(A similar J# method also would do it.)
For certain reasons, I'd like to call a predefined method,
not a method written by me. Otherwise It would be easy.
I thought that the method »random« on this page would fit:
msdn.microsoft.com/en-us/library/41336409(v=vs.94).aspx
. So, I tried to refer to it:
csc /reference:C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.JScript.dll Program.cs
. However, I cannot discover any types from this assembly
(but I do not get an error message either.)
This small program tries to discover the JScript assembly:
public sealed class Program
{ public static void Main()
{ System.Reflection.Assembly[] assemblies =
System.AppDomain.CurrentDomain.GetAssemblies();
foreach( System.Reflection.Assembly assembly in assemblies )
{ System.Console.Out.WriteLine( "Assembly: {0}", assembly );
foreach( System.Type type in assembly.GetExportedTypes())
{ System.Console.Out.WriteLine( "Type: {0}", type ); }}}}
It shows »mscorlib« and »Program«, but I'd also like to see »JScript«.
Assembly: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Type: System.Object
...
Type: System.Math
...
Assembly: Program, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
Type: Program
»System.Math« is there, but not other type with »Math« in
its name.
Can you explain to me what I need to do in order to access
the JScript Math.random() method from my C# program?
(A similar J# method also would do it.)