how to convert string into code?
-
I am prigramming a new "language" o programming The user writes in the new "language" and then I translate it into c# the translation is a string how do the sing becomes a code that can be executed? :)
-
I am prigramming a new "language" o programming The user writes in the new "language" and then I translate it into c# the translation is a string how do the sing becomes a code that can be executed? :)
-
It needs to be compiled. C# is not a scripting language [^]
there must be a way to do this! for example: textbox1.text="button1.backcolor=system.drawing.color.red" how will it become red???
-
I am prigramming a new "language" o programming The user writes in the new "language" and then I translate it into c# the translation is a string how do the sing becomes a code that can be executed? :)
I think you can take the text that user written in your new language and translate into C#, then write it to a .cs file and compile it with csc.exe. CSharp Compiler is available in every machine which has .NET Framework installed in it. And of course user will have .NET Framework installed. OR You can use Microsoft.CSharp.CSharpCodeProvider to compile and run code in real-time. Run-Time Code Generation I: Compile C#-Code using Microsoft.CSharp and System.CodeCom.Compiler[^]
-
I think you can take the text that user written in your new language and translate into C#, then write it to a .cs file and compile it with csc.exe. CSharp Compiler is available in every machine which has .NET Framework installed in it. And of course user will have .NET Framework installed. OR You can use Microsoft.CSharp.CSharpCodeProvider to compile and run code in real-time. Run-Time Code Generation I: Compile C#-Code using Microsoft.CSharp and System.CodeCom.Compiler[^]
this program in the link is not running. o I can not relly understand and I need to know it in "emergency" is there any ggod example?
-
this program in the link is not running. o I can not relly understand and I need to know it in "emergency" is there any ggod example?
I tried it now and I couldn't get it worked too. But I will try some more, if it works I will let you know.
-
I tried it now and I couldn't get it worked too. But I will try some more, if it works I will let you know.
Thank you! I apiciate and hope!
-
Thank you! I apiciate and hope!
I researched about this topic a little and written a program which is I think enough for you to understand how CodeProvider works. Just run the project and enter
using System;
using System.Collections.Generic;
using System.Text;namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("IS IT WORKING!!");
Console.ReadLine();
}
}
}to the textbox. Then press Generate. The compiled executable will be in the same direcory as your program is, as "product.exe" http://rapidshare.com/files/227199842/RealTime_Csharp_Code_Compiler.rar[^] Let me know what you think.
-
I researched about this topic a little and written a program which is I think enough for you to understand how CodeProvider works. Just run the project and enter
using System;
using System.Collections.Generic;
using System.Text;namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("IS IT WORKING!!");
Console.ReadLine();
}
}
}to the textbox. Then press Generate. The compiled executable will be in the same direcory as your program is, as "product.exe" http://rapidshare.com/files/227199842/RealTime_Csharp_Code_Compiler.rar[^] Let me know what you think.
It works for me! :-\
-
there must be a way to do this! for example: textbox1.text="button1.backcolor=system.drawing.color.red" how will it become red???