C# Class Schumix.Framework.Util.Utilities

Show file Open project: Schumix/Schumix2

Public Methods

Method Description
CleanHomeDirectory ( bool server = false ) : void
ClearAttributes ( string currentDir ) : void
CopyDirectory ( string source, string target ) : void
CreateDirectory ( string Name ) : void
CreateFile ( string Name ) : void
CreatePidFile ( string Name ) : void
DownloadFile ( string url, string filename ) : void
DownloadString ( Uri url, Regex regex, int maxlength ) : string
DownloadString ( Uri url, int maxlength ) : string
DownloadString ( Uri url, int timeout, Regex regex, int maxlength ) : string
DownloadString ( Uri url, int timeout, string Contains, NetworkCredential credential, int maxlength ) : string
DownloadString ( Uri url, int timeout, string Contains, int maxlength ) : string
DownloadString ( Uri url, string Contains, NetworkCredential credential, int maxlength ) : string
DownloadString ( Uri url, string Contains, int maxlength ) : string
DownloadString ( string url, Regex regex, int maxlength ) : string
DownloadString ( string url, int maxlength ) : string
DownloadString ( string url, int timeout, Regex regex, int maxlength ) : string
DownloadString ( string url, int timeout, string Contains, NetworkCredential credential, int maxlength ) : string
DownloadString ( string url, int timeout, string Contains, int maxlength ) : string
DownloadString ( string url, string Contains, NetworkCredential credential, int maxlength ) : string
DownloadString ( string url, string Contains, int maxlength ) : string
GetCpuId ( ) : string

Gets the cpu brand string.

GetDateTimeFromUnixTime ( long unixTime ) : System.DateTime

Gets the date time from unix time.

GetEpochTime ( ) : long

Gets the time since the Unix epoch.

GetEpochTimeFromDT ( ) : long

Gets the time between the Unix epich and a specific time.

GetEpochTimeFromDT ( System.DateTime time ) : long

Gets the time between the Unix epich and a specific time.

GetFunctionUpdate ( ) : string
GetRandomString ( ) : string
GetSpecialDirectory ( string data ) : string
GetSystemTime ( ) : long

Gets the system uptime.

GetSystemTimeLong ( ) : long

Gets the system uptime.

Even though this returns a long, the original value is a 32-bit integer, so it will wrap back to 0 after approximately 49 and half days of system uptime.

GetUTCTimeMillis ( long millis ) : System.DateTime

Gets the UTC time from millis.

GetUTCTimeSeconds ( long seconds ) : System.DateTime

Gets the UTC time from seconds.

GetUnixTimeStart ( ) : System.DateTime
GetUrl ( string url ) : string
GetUrl ( string url, string args ) : string
GetUrl ( string url, string args, string noencode ) : string
GetUrlEncoding ( string url, string encoding ) : string
GetUrlEncoding ( string url, string args, string encoding ) : string
GetUrlEncoding ( string url, string args, string noencode, string encoding ) : string
GetUrls ( string text ) : List

Gets the URLs in the specified text.

GetUserName ( ) : string
GetVersion ( ) : string
IsDay ( int Year, int Month, int Day ) : bool
IsPrime ( long x ) : bool
IsSpecialDirectory ( string dir ) : bool
IsValueBiggerDateTimeNow ( int Year, int Month, int Day, int Hour, int Minute ) : bool
MD5File ( string fileName ) : string
Md5 ( string value ) : string
MoveDirectory ( string source, string target ) : void
NameDay ( string Language ) : string
RemovePidFile ( ) : void
Sha1 ( string value ) : string
SqlEscape ( string text ) : string
ToMilliSecondsInt ( int ticks ) : int

Converts ticks to miliseconds.

Private Methods

Method Description
Utilities ( ) : System

Method Details

CleanHomeDirectory() public method

public CleanHomeDirectory ( bool server = false ) : void
server bool
return void

ClearAttributes() public method

public ClearAttributes ( string currentDir ) : void
currentDir string
return void

CopyDirectory() public method

public CopyDirectory ( string source, string target ) : void
source string
target string
return void

CreateDirectory() public method

public CreateDirectory ( string Name ) : void
Name string
return void

CreateFile() public method

public CreateFile ( string Name ) : void
Name string
return void

CreatePidFile() public method

public CreatePidFile ( string Name ) : void
Name string
return void

DownloadFile() public method

public DownloadFile ( string url, string filename ) : void
url string
filename string
return void

DownloadString() public method

public DownloadString ( Uri url, Regex regex, int maxlength ) : string
url System.Uri
regex System.Text.RegularExpressions.Regex
maxlength int
return string

DownloadString() public method

public DownloadString ( Uri url, int maxlength ) : string
url System.Uri
maxlength int
return string

DownloadString() public method

public DownloadString ( Uri url, int timeout, Regex regex, int maxlength ) : string
url System.Uri
timeout int
regex System.Text.RegularExpressions.Regex
maxlength int
return string

DownloadString() public method

public DownloadString ( Uri url, int timeout, string Contains, NetworkCredential credential, int maxlength ) : string
url System.Uri
timeout int
Contains string
credential System.Net.NetworkCredential
maxlength int
return string

DownloadString() public method

public DownloadString ( Uri url, int timeout, string Contains, int maxlength ) : string
url System.Uri
timeout int
Contains string
maxlength int
return string

DownloadString() public method

public DownloadString ( Uri url, string Contains, NetworkCredential credential, int maxlength ) : string
url System.Uri
Contains string
credential System.Net.NetworkCredential
maxlength int
return string

DownloadString() public method

public DownloadString ( Uri url, string Contains, int maxlength ) : string
url System.Uri
Contains string
maxlength int
return string

DownloadString() public method

public DownloadString ( string url, Regex regex, int maxlength ) : string
url string
regex System.Text.RegularExpressions.Regex
maxlength int
return string

DownloadString() public method

public DownloadString ( string url, int maxlength ) : string
url string
maxlength int
return string

DownloadString() public method

public DownloadString ( string url, int timeout, Regex regex, int maxlength ) : string
url string
timeout int
regex System.Text.RegularExpressions.Regex
maxlength int
return string

DownloadString() public method

public DownloadString ( string url, int timeout, string Contains, NetworkCredential credential, int maxlength ) : string
url string
timeout int
Contains string
credential System.Net.NetworkCredential
maxlength int
return string

DownloadString() public method

public DownloadString ( string url, int timeout, string Contains, int maxlength ) : string
url string
timeout int
Contains string
maxlength int
return string

DownloadString() public method

public DownloadString ( string url, string Contains, NetworkCredential credential, int maxlength ) : string
url string
Contains string
credential System.Net.NetworkCredential
maxlength int
return string

DownloadString() public method

public DownloadString ( string url, string Contains, int maxlength ) : string
url string
Contains string
maxlength int
return string

GetCpuId() public method

Gets the cpu brand string.
public GetCpuId ( ) : string
return string

GetDateTimeFromUnixTime() public method

Gets the date time from unix time.
public GetDateTimeFromUnixTime ( long unixTime ) : System.DateTime
unixTime long The unix time.
return System.DateTime

GetEpochTime() public method

Gets the time since the Unix epoch.
public GetEpochTime ( ) : long
return long

GetEpochTimeFromDT() public method

Gets the time between the Unix epich and a specific time.
public GetEpochTimeFromDT ( ) : long
return long

GetEpochTimeFromDT() public method

Gets the time between the Unix epich and a specific time.
public GetEpochTimeFromDT ( System.DateTime time ) : long
time System.DateTime the end time
return long

GetFunctionUpdate() public method

public GetFunctionUpdate ( ) : string
return string

GetRandomString() public method

public GetRandomString ( ) : string
return string

GetSpecialDirectory() public method

public GetSpecialDirectory ( string data ) : string
data string
return string

GetSystemTime() public method

Gets the system uptime.
public GetSystemTime ( ) : long
return long

GetSystemTimeLong() public method

Gets the system uptime.
Even though this returns a long, the original value is a 32-bit integer, so it will wrap back to 0 after approximately 49 and half days of system uptime.
public GetSystemTimeLong ( ) : long
return long

GetUTCTimeMillis() public method

Gets the UTC time from millis.
public GetUTCTimeMillis ( long millis ) : System.DateTime
millis long The millis.
return System.DateTime

GetUTCTimeSeconds() public method

Gets the UTC time from seconds.
public GetUTCTimeSeconds ( long seconds ) : System.DateTime
seconds long The seconds.
return System.DateTime

GetUnixTimeStart() public method

public GetUnixTimeStart ( ) : System.DateTime
return System.DateTime

GetUrl() public method

public GetUrl ( string url ) : string
url string
return string

GetUrl() public method

public GetUrl ( string url, string args ) : string
url string
args string
return string

GetUrl() public method

public GetUrl ( string url, string args, string noencode ) : string
url string
args string
noencode string
return string

GetUrlEncoding() public method

public GetUrlEncoding ( string url, string encoding ) : string
url string
encoding string
return string

GetUrlEncoding() public method

public GetUrlEncoding ( string url, string args, string encoding ) : string
url string
args string
encoding string
return string

GetUrlEncoding() public method

public GetUrlEncoding ( string url, string args, string noencode, string encoding ) : string
url string
args string
noencode string
encoding string
return string

GetUrls() public method

Gets the URLs in the specified text.
public GetUrls ( string text ) : List
text string /// The text to search in. ///
return List

GetUserName() public method

public GetUserName ( ) : string
return string

GetVersion() public method

public GetVersion ( ) : string
return string

IsDay() public method

public IsDay ( int Year, int Month, int Day ) : bool
Year int
Month int
Day int
return bool

IsPrime() public method

public IsPrime ( long x ) : bool
x long
return bool

IsSpecialDirectory() public method

public IsSpecialDirectory ( string dir ) : bool
dir string
return bool

IsValueBiggerDateTimeNow() public method

public IsValueBiggerDateTimeNow ( int Year, int Month, int Day, int Hour, int Minute ) : bool
Year int
Month int
Day int
Hour int
Minute int
return bool

MD5File() public method

public MD5File ( string fileName ) : string
fileName string
return string

Md5() public method

public Md5 ( string value ) : string
value string
return string

MoveDirectory() public method

public MoveDirectory ( string source, string target ) : void
source string
target string
return void

NameDay() public method

public NameDay ( string Language ) : string
Language string
return string

RemovePidFile() public method

public RemovePidFile ( ) : void
return void

Sha1() public method

public Sha1 ( string value ) : string
value string
return string

SqlEscape() public method

public SqlEscape ( string text ) : string
text string
return string

ToMilliSecondsInt() public method

Converts ticks to miliseconds.
public ToMilliSecondsInt ( int ticks ) : int
ticks int
return int