|
Hi,
I am developing a scripting tool in which I want to compile and execute the code in MEMORY, not as an executable file. But in there I need to redirect the console output to a Richtextbox and input to a simple textbox.
Example:
The script code is like this
public class Script
{
public static void Main()
{
Console.WriteLine("Hello World");
Console.ReadKey();
}
}
When I compile and execute in memory I want to print "Hello World" in a richtextbox and input the key from a textbox to terminate the application.
How can I accomplish it? I know how to redirect input/output if it is an executable file, but I don't know how to do the same for in-memory execution. Can anyone please help me?
|
|
|
|
|
What is the benefit you are seeking by compiling and executing in memory? Does it outweigh the risks of potential security vulnerabilities this exposes?
If this needed, why compile an entire application, just use the particular method that is necessary for your functionality.
only two letters away from being an asset
|
|
|
|
|
That is not the point. OK instead of in-memory execution I invoke the entry point function from the compiled assembly. But there also how would I redirect the console input output to a textbox or richtextbox?
|
|
|
|
|
Anindya Chatterjee wrote: how would I redirect the console input output to a textbox or richtextbox?
You don't. Execute the method from the assembly, get the output, then assign it to the textbox in your application.
only two letters away from being an asset
|
|
|
|
|
Sorry, I didn't get that.
If the script has a line like:
Console.WriteLine("Hello World");
then how would I get the output and assign to the textbox? That entry-point function is not returning any string. If I am wrong please correct me with some example.
And also what about
Console.ReadKey() or Console.ReadLine(...) ?
Thanks and regards,
|
|
|
|
|
That's the point you can't do this. And why would you want to? If you have a textbox in your application and you need to pass the value from the textbox to an external application, then why do you need to try reassigning the input stream? Sounds more like you need to refactor the external application.
only two letters away from being an asset
|
|
|
|
|
Hi,
In datagridview, I want to change the color of particular gridline.
There is option to change all gridlines to any color but want to change particular gridline color.
Thanks in Advance.
GTag
|
|
|
|
|
Hello.
We got a newbie question on XML tags for documentation (only partly referring to C#):
The text needs to use the data type of a function (or a function parameter). The documentation text goes the same for all programming languages though you have different data type namings in C#, VB.NET, C++ ... As an example, in C# and C++ you have float data type but VB names it Single .
A code example (VB here):
''' <summary>The function <cref name="myFunction"/> has the data type Single/float.</summary>
Public Function myFunction As Single()
Return myFunction(Me.Count)
EndFunction
Can we refer to the data type naming as we do to the function name? Could be a tag like <creftype name="myFunction"/>
We use VS2008 (and Sandcastle for html help).
Thanks for hints
Guido Carl
modified on Tuesday, September 8, 2009 7:40 AM
|
|
|
|
|
float is an alias for System.Single. So you can write,
public float MyFunction()
{
}
|
|
|
|
|
Thanks. So easy if you know about it.
Guido
|
|
|
|
|
Hi everyone there, I searched alot but didnt get any source to find out how I can add Icons or images on the left side of my context menu or context menu strip. Any urgent reply will be appreciated.
Regards
|
|
|
|
|
Every ToolStripMenuItem you add to your context menu has an Image property.
|
|
|
|
|
I want to make an iphone style scrolling. I tryed to set the scroll position(in a loop) on mouse click but my application is flickering when doing that.
can anybody explain/solve my problem?
|
|
|
|
|
Often, setting the DoubleBuffer style of your Form or Panel will solve the flickering problem:
this.SetStyle (ControlStyles.DoubleBuffer, true);
|
|
|
|
|
|
Something like this works:
private const int WM_ENTERSIZEMOVE = 0x0231;
private const int WM_EXITSIZEMOVE = 0x0232;
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
switch (m.Msg)
{
case WM_ENTERSIZEMOVE:
this.Opacity = 0.5;
break;
case WM_EXITSIZEMOVE:
this.Opacity = 1.0;
break;
}
this.Invalidate();
}
Still trying to get rid of the small flicker....
The only programmers that are better C# programmers, are those who look like this -> |
Programm3r
My Blog: ^_^
|
|
|
|
|
|
So...what's the question? How does that image relate?
|
|
|
|
|
|
This [^]may give you an idea.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
hi .
Please help me .I want to insert color in the line of the richtextbox.In fact when user clicked on the lines of the rtb , i want to changed background color of the that line .
|
|
|
|
|
Hi.
I want highlighting current row in the rtb . please help me .
|
|
|
|
|
Hello Everyone...
There is a need to do below for one of my project which i ma doing for learning purpose... i am finding it difficult to implement... please give me some direction on this...
i want to send an email to so many any people in diffrent world areas.
what i need is that when any of Recipient opens/selects that email in thier outlook client, it shall open a pop up kind of window where i can ask my friend to provide thier birthday details (in some netry field in the window) and then say "ok" or something. which shall send a email back to my id(that is sender's id)...
the main dificulty i am getting is to send mail, we need to know exchge server details of that user's system. how do we get that... like that opening window from outlook mail is unknown to me...
it would be really helpful if some of you can share your knowledge with me which shall help me to achieve this...
"You just become, like a flower becomes the fruit. It's all built in within you. Allow it to work out."
-- Shri Mataji Nirmala Devi.........
for more details visit : http://www.sahajayoga.org
Akhilesh Singh
modified on Wednesday, August 26, 2009 5:41 AM
|
|
|
|
|
Hmm... you look like a spammer. You need a confirmation, the the email address exists.
|
|
|
|
|
Hi... thanks for response though it was little tough...
i shall have told in starting that i am not doing any business advertisement thought these mails... i just want to collect birthdays of so many of my firends whom i will send this mail and automate this birthday collection...
thats all whole idea is... in place of asking each of my friend to give thier bdays which i never collected and stored properly i want to do it though automated thing...
and buddy i am not a spammer... you ask me few C# basic questions and if i know ans i will reply same otherwise atleast i will reply i don'y know... thanks any way...
"You just become, like a flower becomes the fruit. It's all built in within you. Allow it to work out."
-- Shri Mataji Nirmala Devi.........
for more details visit : http://www.sahajayoga.org
Akhilesh Singh
modified on Wednesday, August 26, 2009 5:41 AM
|
|
|
|