ok i want to write a c# program for rapidshare ,the purpose of this program is to restart rapidshare when it raises an error message,(that i cant get rid off.)so i need to put a handle on the rapidshare download manager and as soon as rapidshare raises the error message,the application should close rapidshare and relaunch it again.so i want to know how to put a handle on the rapidshare program so that i can take the appropriate action
this is a code i wrote,i got the name of the program that is rapidshare
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.Runtime;
using System.Runtime.InteropServices;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
runningpro();
}
public void runningpro()
{
string name; int i = 0;
Process[] proc;
proc = Process.GetProcesses();
foreach (Process procs in proc)
{
name = procs.ProcessName;
procs.Refresh();
if (name == "RapidShareManager")
{
MessageBox.Show("rapidshare is open is open");
}}
}
private void button1_Click(object sender, EventArgs e)
{
runningpro();
}
}
}