[Solved] change method code at run time [closed]


My advise:

A code at run time cannot be editted!

Specially when you’re running the code and a client is using the service. You can edit the code by yourself only. Client would be using if else block statements only.

You can edit the code, and add some if else blocks to it, so that each time the user loads the page; due to those if else blocks, the code seems to be change!

But you cannot let the user edit it. It is less secure!

You asked for it:

However, you can still let them edit the page, as this (since you mentioned asp.net)

// create some variables
var DataToWrite = /* suppose this as the main variable; having others in it */;
var dataFile = Server.MapPath("~/folder/file.txt"); // find the file
File.WriteAllText(@dataFile, userData); // write the lines to the file
result = "Information saved."; // show the result if any..

You can try out other stuff too, learn them here: http://www.asp.net/web-pages/tutorials/files,-images,-and-media/working-with-files

2

solved change method code at run time [closed]