private async void bStop_Click(object sender, EventArgs e) { try { Cursor = Cursors.WaitCursor; await AspManager.Stop(); MessageBox.Show("Site successfully stopped", "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> Stop() { await AspManager.Stop(); return(Request.CreateResponse(HttpStatusCode.OK, new { result = "Success", message = "IIS site successfully stoped" })); }