Hi,
mit einer Extension Methode kannst Du dir das einfacher machen.
[Extension()]
public bool IsInRange(Int64 Value, Int64 MinValue, Int64 MaxValue)
{
bool Result = true;
if (Value < MinValue || Value > MaxValue) {
Result = false;
}
return Result;
}
Damit kannst Du dann bspw. sowas machen:
Int64 myValue = 4711;
bool valid = myValue.IsInRange( 0, 2000 );
Gruß, Stefan
Microsoft MVP - Visual Developer ASP/ASP.NET
http://www.asp-solutions.de/ - Consulting, Development
http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community