Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to make an app that when you press a button, it reads a textfile, and executes the code inside it.

I am reading the textfile via streamreader (readtoend) , now i would like to execute the code read from the text file...

I already have my Resources which I could use if needed (below)

thank you.

Sample of how the resources look:

VB.NET
Imports System.Net
Imports System.Text.Encoding
Imports System.Net.Sockets
Imports System
Imports System.IO.Ports
Imports System.IO
Imports System.Threading
Imports System.ComponentModel
Imports WindowsApplication1
Imports System.CodeDom
Imports System.CodeDom.Compiler
Imports Microsoft.Win32
Imports Microsoft.CSharp
Imports Microsoft.VisualBasic
Imports System.IO.File
Imports System.Windows.Forms

Public Class testfromfile

        %111%

End Class


What I have tried:

INITIAL APPROACH: I was thinking of replacing the values %111% from the resources with the info of the streamreader and then executing the code....

any ideas how to do this? tried CodeDom but was not able to make it work.
Posted
Updated 14-Oct-16 9:56am
v2
Comments
[no name] 14-Oct-16 15:25pm    
CodeDom is the way to do it and "not able to make it work" tells us nothing about your problem.
Maciej Los 14-Oct-16 15:52pm    
Not a question at all!

1 solution

 
Share this answer
 
Comments
CPallini 14-Oct-16 16:41pm    
5.
Maciej Los 14-Oct-16 16:43pm    
Thank you, Carlo.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900