?? exceptionutilities.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;
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -