I have a button in a sharepoint web part that when clicked is supposed to launch the calculator:
protected void Button1_Click(object sender, EventArgs e)
{
Process process = new Process();
process.StartInfo = new ProcessStartInfo("Calc.exe");
process.Start();
}
However, when the button is clicked, nothing happens. Can someone tell me how to launch applications from a sharepoint web part?
Quite frankly this is not possible. The code you have written is executed on the SharePoint server in the security context of the web app user. So if anything happens at all, a calculator is opened for the web app user and certainly not for your user.
If you want to do something like this you have to revert to client side scripting technologies, e.g.
SilverlightorJavaScript. However, you have to deal with permission issues then as scripts normally can’t access the local hard disk to improve security.