mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-05-15 08:56:56 +02:00
SMBServer v1.0.5
This commit is contained in:
parent
b75820452d
commit
bd1006cb81
400 changed files with 28062 additions and 0 deletions
52
Utilities/Conversion/Conversion.SimpleTypes.cs
Normal file
52
Utilities/Conversion/Conversion.SimpleTypes.cs
Normal file
|
@ -0,0 +1,52 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
|
||||
namespace Utilities
|
||||
{
|
||||
public partial class Conversion
|
||||
{
|
||||
public static int ToInt32(object obj)
|
||||
{
|
||||
return ToInt32(obj, 0);
|
||||
}
|
||||
|
||||
public static int ToInt32(object obj, int defaultValue)
|
||||
{
|
||||
int result = defaultValue;
|
||||
if (obj != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
result = Convert.ToInt32(obj);
|
||||
}
|
||||
catch
|
||||
{}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static long ToInt64(object obj)
|
||||
{
|
||||
return ToInt64(obj, 0);
|
||||
}
|
||||
|
||||
public static long ToInt64(object obj, long defaultValue)
|
||||
{
|
||||
long result = defaultValue;
|
||||
if (obj != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
result = Convert.ToInt64(obj);
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue