Пример #1
0
        private async void bRestart_Click(object sender, EventArgs e)
        {
            try
            {
                Cursor = Cursors.WaitCursor;

                await AspManager.Restart();

                MessageBox.Show("Site successfully restarted", "Success", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OKCancel, MessageBoxIcon.Error);
            }
            finally
            {
                Cursor = Cursors.Hand;
            }
        }
Пример #2
0
        public async Task <HttpResponseMessage> Restart()
        {
            await AspManager.Restart();

            return(Request.CreateResponse(HttpStatusCode.OK, new { result = "Success", message = "IIS site successfully restarted" }));
        }