|
I think that he's aiming for is an exe that is encrypted so it can't be decompiled.
After decompiling the app he doesn't want to cache it to disk so Process.Start wont work.
|
|
|
|
|
The principle's still the same. In order to run the application, you would have an encrypted app which you would then fire off using another application. This other application would be responsible for decrypting the application and starting it off. The hint is that you could decrypt the encrypted exe to a stream and then use Assembly.Load to load the executable.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I was thinking that it could be any application, not just a .Net one.
|
|
|
|
|
But, this is the C# forum. If it's not .NET then he's in the wrong forum
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
The way I read it was that he wants to make a C# app that can decrypt and execute any application without writing it to disk.
Of course this is all assumption built on lack of information hehe :P
|
|
|
|
|
Hi,
I'm trying to update a property on an arraylist of visual components on a form, getting the property value to set by calling a method on another object. However, performance is unacceptably slow.
public delegate void VisualComponentUpdateHandler(VisualComponent v, int val);<br />
public void VisualComponentUpdate(VisualComponent v, int val)<br />
{<br />
v.Value = val;<br />
}
and running in a seperate thread:
<br />
VisualComponentUpdateHandler d = new VisualComponentUpdateHandler(VisualComponentUpdate);<br />
int val;<br />
while (true)<br />
{<br />
foreach (VisualComponent v in visualComponentArrayList)<br />
{<br />
val = sourceObject.GetValue(Convert.ToInt32(v.Name));<br />
d.Invoke(v, val)<br />
}<br />
Thread.Sleep(100);<br />
}
I added the Thread.Sleep(100) because without it, the visuals don't seem to update.
I've got anything up to 128 of the visual components to update - they're custom components derived from ProgressBar, displaying a measurement which is obtained from a program running on a seperate machine which passes a new sourceObject every 250ms to the program via .NET remoting (this updating mechanism runs in another thread and doesn't seem to be affected by the slowdown in response which occurs when the property update thread is running).
|
|
|
|
|
Hi,
Might be a stupid questions, but.. Why are you doing d.Invoke(v, val) ? Shouldn't it be v.Invoke(d, new object[]... or something like that? You are attempting to marshall back to the gui thread to update your control right? I think Delegate.Invoke would spawn yet another thread , where it may not be safe to update GUI Controls (which might explain why you need a sleep to make it work)
Bijesh
--------------------------------------------------
|
|
|
|
|
Yes, sorry - I made a typo. It does work; it's just that it renders the GUI too unresponsive. I'm looking for smooth-ish updating on all of the controls and looping through them (even with Thread.Sleep in there) seems to result in massive CPU load and sluggish display. Perhaps it is something to do with the way in which the thread which performs the invoke calls back to the GUI thread obtains the values to set the component properties to (it's not too bad if I just generate some numbers within the updating thread and use those instead).
Back to the drawing board. Thanks.
|
|
|
|
|
Right, got it. Suspicion confirmed. The object I was calling the method on in order to get the values was being blocked by another thread accessing it. Stick the invokes to update the component properties into the same thread and the problem's gone away. Thanks ;P
|
|
|
|
|
Hello fellows. I need your help. I have a Windows.Forms application which makes a connection to a database about 5 - 10 seconds. While I'm trying to connect to the database, an animated control starts an animation . After the connection is made I stop the animation and want to run another function to fill a DataGrid control.
private void OpenConFunction()
{
//... some code
}
private void AfterConnFunction()
{
//... some code to fill DataGrid control
}
private void myButton_Click(object sender, System.EventArgs e)
{
Thread t = new Thread(new ThreadStart(OpenConFunction));
t.Start();
this.AnimatedControl.Start(); //Suppose AnimatedControl
//has two methods one to start animation and a second one to stop it
}
What has to be the code after OpenConFunction returns? I want to invoke the AfterConnFunction and stop the AnimatedControl animation?
|
|
|
|
|
i would recommend u a simplest way...
call the animation method asynchronously , inside which u have following code
{
this.AnimatedControl.start();
while(!bnFinishedFlag)
{
//do nothing
//bnFinished flag is class level var and will be set to true when db
//operation finishes
}
this.AnimatedControl.stop();
//end the async method call..
}
hope this helps//..
|
|
|
|
|
Thanks for the reply. Unfortunately, your suggestion didn't help me. I think I need to call the OpenConFunction() in a separate thread. But I don't know how to start the AfterConnFunction when OpenConFunction ends.
|
|
|
|
|
I mean when I start the OpenConnFunction() in a separate thread the animation starts otherwise not
|
|
|
|
|
You can do this using Invoke and delegates. In your OpenConFunction method, once you are done openig the connection you can do an
this.BeginInvoke( new AfterConnFunctionDelegate( AfterConnFunction) )
where AfterConnFunctionDelegate is declared as a delegate with the same type as AfterConnFunction.
public delegate void AfterConnFunctionDelegate();
In the AfterConnFunction method you can safely call this.AnimatedControl.Stop()
--------------------------------------------------
|
|
|
|
|
Brilliant!! Thank you
|
|
|
|
|
hi ,
i use c# web services to retrieve data from a provider.
I would like to log incoming and outgoing xml soap messages when i call a method and when a response arrives..
is there a way to do this ?
|
|
|
|
|
|
Hi friends
How to connect a database in c#
thanks in advance
KK
|
|
|
|
|
|
Hi, I have a ToolStrip control with a BackgroundImage that I would like to align to the right. Is there any way to do this? /Thanks
-- modified at 8:43 Tuesday 3rd April, 2007
|
|
|
|
|
hi
iam getting the following error while i am updating database . here i am getting data from XL sheet
Cannot update. Database or object is read-only
can u plz give me ur ideas
thank u
Suresh.R
|
|
|
|
|
I assume by XL you mean Excel ... I know typing 3 more letters might take up your valuable time but being accurate might help when asking a question
The clue is in what the error message says. Why would it be read only? Possibly because the file has the read only flag set, also possibly because you have the file open in another application?
|
|
|
|
|
originSH wrote: I assume by XL you mean Excel ... I know typing 3 more letters might take up your valuable time but being accurate might help when asking a question
Got my "5" for posting this!
Where is this kind of writing coming from? SMS, chatrooms or am I simply to old?
All the best,
Martin
|
|
|
|
|
it is what i call txtspk and I hate it. It comes from mobile phone sms messages having a limited keyboard/screen/text length. Something which is not the case on a message board such as CP.
|
|
|
|
|
J4amieC wrote: and I hate it
J4amieC wrote: Something which is not the case on a message board such as CP.
Well said!
Thanks!
|
|
|
|