|
Right, I was just saying that you could load the referenced assembly in the same appdomain and then upload that appdomain.
Picture a huge catholic cathedral. In it there's many people, including a gregorian monk choir. You know, those who sing beautifully. Then they start singing, in latin, as they always do: "Ad hominem..."
-Jörgen Sigvardsson
|
|
|
|
|
|
Okay, he probably meant AppDomain.Unload, but this is not working.
I will try today to impement a WaitHandle to set a ManualResetEvent so that the assembly stop processing if the service singals that it should stop, so hopefully the unload will work.
The funny thing is that this area is much improvedin Framework 2.0, you can do anything with unloading single assemblies from the AppDomain.
Thanks.
Sarajevo, Bosnia
|
|
|
|
|
I've tried loading assemblies that in turn refer to other assemblies in an AppDomain and it worked.
mirano wrote: This is where the app hangs.
Have you implemented any finalizers in your code? It's very much possible that one of the finalizers hung and that resulted in the hang?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Can anyone help me with this:
I have a windows service(Already created)
That I want to read app.config,
and launch a DLL, (NOT an exe...)
This DLL, will also be called by a webpage at some point,
which is why we are using a dll, and not an exe...
(It is hard to shell an exe from a webpage inside the corp firewall)
Any suggestions? Comments?
Thanks,
Mike
|
|
|
|
|
What do you mean "launch a DLL"? Assemblies and shared objects contain executable stuff but without a context to run against its pointless. As far as the platform knows, it is just a collection of functions. By itself, there is no execution instructions or order let alone rhyme or reason so how can it ever be launched?
The purpose of a "service" is to often do non-"user interactive" tasks so why would you want the service to run anything external? Why not incorportate the functionality inside of the service itself?
I suspect you either misunderstand the purpose of the assembly/shared object or you need to provide more information.
|
|
|
|
|
Hi guys!
I have a question to do:
i wanna know how to check if a task is executing or not..(programmatically i mean)
thank you
Enrico
|
|
|
|
|
Checkout the Process[^] class and it's Responding property along with it's GetProcesses method.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have a openFileDialog which allows the user to specify the location of an application to open. He also selects times to open and close the application. Now all I need to know how to do is run the application.
So ... does anyone know how to execute an external application that has the path to the executable specified?
Thanks!
|
|
|
|
|
System.Diagnostics.Process
here is an example of running PING with some arguments:
<code>
using System.Diagnostics;
public void RunPing()
{
Process p = new Process();
p.StartInfo.Arguments = "www.codeproject.com";
p.StartInfo.FileName = "ping.exe";
p.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
p.Start();
p.WaitForExit(5000);
}
</code>
|
|
|
|
|
Hi
My network has a restriction and it doesnt allow me to download files from the internet for eq. .zip, .exe, .doc etc...... i believe they have restricted download for all possible file extensions. But i was amazed to see that it does allow me to download zip files from certain sites for eg. i am able to download the zip file from this loacation
https://www.microsoftelearning.com/ek_content/content/enus_085636/lsn_2/tpc_b/enus_085636_02b_4_procedures.zip[^]
but i am not able to download the zip file for this location
http://codeproject.com/miscctrl/gridctrl/gridctrl_demo225.zip[^]
Can anyone explain me why this is happening.
Regards
Deepak
|
|
|
|
|
No offense to you, but you can probably get a better answer in a different forum than the c# forum. I'll do the best I can though:
Firewalls allow the ability to restrict/allow on a URL name basis. Whoever set up your network probably has codeproject.* allowed.
|
|
|
|
|
I did think abt that befor posting but i found too many people answering in this forum so i thought i will try my luck... Guess i am not that lucky.
|
|
|
|
|
General rant to everyone who posts in the wrong forum (not just you):
What if everyone did what you did? That would mean that everything would be posted in one single forum, and the system of forum would become completely useless.
Also by posting in the wrong forum you reduce your chances of getting help. You annoy a lot of people, and the wrong people also. Think about how you do in real life: If you have a question about banking, do you go the the small bank office, or the big supermarket?
---
b { font-weight: normal; }
|
|
|
|
|
I have two images. One is dynamically create, the other is loaded into memory from an image on the harddrive. They are the same size.
Is there an Image method built into C# to compare the two images for equality? I've looked, but found nothing.
I have another case, also. I have a large bitmap (800,600) and I have a small image (20,20). I want to see if there is a 20x20 section in the large bitmap which matches the small image. The sizes will vary, because I need to do this with more than one image. Basically, is there an effecient way to see if a smaller bitmap is contained within a larger bitmap?
Thanks.
|
|
|
|
|
No there are no predefined functions. But both algorithms should be fearly easy to implement. Its just about looping through two images and comparing their pixel values. To access those the easiest method are the Get/SetPixel methods of the Bitmap class, but they are very slow. For faster processing you will need some code. Have a look at these articles. Part 1 already shows how to go unsafe into a Bitmap but the other parts probably give you some more insight.
|
|
|
|
|
its very simple to do this.
first , check the width/height ration between the both pictures , if they differ they are not the same image
then shrink both pictures to some managble size (eg by making a thumbnail of them both)
this is will make it possible to compare images with the same width/height ration but with different width / height , where one image is smaller than the other
then do a little loop that checks each pixel in both
then compare those pixels with some sort of treashold.
this way you can compare images with different sizes and different quallity.
|
|
|
|
|
Im new to c#. Can you advice me how to code saving text from labels or message boxes to file on hdd?
|
|
|
|
|
There are many many different ways to do this. I would research the System.IO.File and System.IO.TextReader and System.IO.TextWriter classes for more help. I could give you an example, but I don't think it would do any good unless we knew what exactly you're trying to do. It could be good as well to research Serialization as this is a nice easy way to Serialize and object to a file.
|
|
|
|
|
Bryan, what do you do, sit here and refresh the C# forum every three seconds?
You're not trying to beat Nish and CG's post counts, are you?
Picture a huge catholic cathedral. In it there's many people, including a gregorian monk choir. You know, those who sing beautifully. Then they start singing, in latin, as they always do: "Ad hominem..."
-Jörgen Sigvardsson
|
|
|
|
|
Haha, I like to take time during my breaks an help people out
I'll catch up to them some day... when I'm older and wiser
|
|
|
|
|
Could you give me a simple example please? What I want to do is simply to save text to something.txt file from textbox or label on button_click event.
|
|
|
|
|
ok.. a VERY simple example would be as such: (This is not at all the complete or best way to do it, just a simple example to start your building blocks)
<code>
public void WriteFile(string text, string fileName)
{
System.IO.TextWriter tw = null;
try
{
if(System.IO.File.Exists(fileName))
{
System.IO.File.Delete(fileName);
}
tw = System.IO.File.CreateText(fileName);
tw.WriteLine(text);
}
finally
{
if(tw != null)
{
tw.Flush();
tw.Close();
}
}
}
</code>
|
|
|
|
|
Doesn't Close() call Flush() automatically?
|
|
|
|
|
That depends on what you're calling .Close() on. I just find it easier to read, and less "implied", to call it myself, no matter what stream type is in use.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|