⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 exceptionutilities.cs

📁 用ADSI操作IIS文件
💻 CS
字号:
// IIsAdmin.NET
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// 
// This softwareis provided "AS IS" with no warranties of any kind.
// The entire risk arising out of the use or performance of the software
// and source code is with you.
//
// THIS NOTICE MAY NOT BE REMOVED FROM THIS FILE.

using System;
using System.Windows.Forms;
using System.Globalization;

namespace IIsAdmin
{
	/// <summary>
	/// Summary description for ExceptionUtilities.
	/// </summary>
	public class ExceptionUtilities
	{
        public static void DisplayException(Exception ex)
        {
            MessageBox.Show("An error occurred, in most cases performing an IIsReset will correct any issues.  Below are the details of the exception:\n\n" + ex.ToString(), "Exception Encountered", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }

        public static void DisplayValidation(string message)
        {
            MessageBox.Show(message, "Invalid Input", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
        }

        public static bool IsNumeric(string expression)
        {
            bool hasDecimal = false;
            for(int i=0;i<expression.Length;i++) 
            { 
                if(expression[i] == '.')
                {
                    if(hasDecimal)
                    {
                        return false;
                    }
                    else // 1st decimal
                    {
                        // inform loop decimal found and continue 
                        hasDecimal = true;
                        continue;
                    }
                }
                // check if number
                if(!char.IsNumber(expression[i])) 
                {
                    return false; 
                }
            } 
            return true; 
        }
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -