OK I found how to get the process and the modules that are attached to those modules... now how do I remove these modules from memory... any help will be greatly appreciated...
Code:
private void Form1_Load(object sender, System.EventArgs e)
{
try
{
System.Diagnostics.Process[] ps = Process.GetProcesses();
string s = "";
for(int i = 0; i < ps.Length; i++)
{
s += "\r\n" + ps[i].ProcessName;
try
{
foreach(ProcessModule childModule in ps[i].Modules)
{
s += "\r\n " + childModule.ModuleName;
if(childModule.ModuleName.ToUpper() == "MYDLL.DLL")
{
//OK so I found my module now
//How do I unload this module from memory
}
}
}
catch
{
}
}
MessageBox.Show(s);
}
catch(Exception exc)
{
MessageBox.Show(exc.Message);
}
}