private async void bRecycle_Click(object sender, EventArgs e) { try { Cursor = Cursors.WaitCursor; await AspManager.Recycle(); MessageBox.Show("IIS pool successfully recycled", "Success", MessageBoxButtons.OKCancel, MessageBoxIcon.Information); } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OKCancel, MessageBoxIcon.Error); } finally { Cursor = Cursors.Hand; } }
public async Task <HttpResponseMessage> Recycle() { await AspManager.Recycle(); return(Request.CreateResponse(HttpStatusCode.OK, new { result = "Success", message = "IIS pool successfully recycled" })); }