-
Notifications
You must be signed in to change notification settings - Fork 0
NSG.Library.Helpers
NSG.Library.Helpers is a collection of support helper (static) methods. The helper methods are in three classes as follows:
- App setting configuration retrieval (Config),
- Files and file system utilities (Files),
- Operation system (OS) command execution (OS).
|
Static helpers for handling AppSettings configuration.
Get a value from the AppSetting section of the web config.
AppSetting key value
if not found return this value
string of the value in the appSetting section in the config file.
Get a value from the AppSetting section of the web config.
AppSetting key value
if not found return this boolean value
boolean value in the appSetting section in the config file.
Get a value from the AppSetting section of the web config.
AppSetting key value
if not found return this integer value
integer value in the appSetting section in the config file.
Static helpers for handling files.
Create a temporary file name.
first part of file name
- tmp
- ni (as in app initials)
- nsg (as in company initials)
the temporary file name extension:
====== file 'extent' examples: ====== * txt * tmp * log
string of prefix followed by GUID and extent
Delete the file
full path and file name
Make a directory
name of the new direcory
Read a file into a in-memory byte array.
full path and file name
byte array
Write a file from an in-memory a byte array.
byte array
full path and file name
Remove the following reserved characters and replace with a space.
* (less than) * > (greater than) * : (colon) * " (double quote) * / (forward slash) * \ (backslash) * | (vertical bar or pipe) * ? (question mark) * * (asterisk) * , (comma) * (amperstand)
file name with out path
A clean file name
Static helpers for handling Operating System interaction.
Execute the operating system command.
The command string to execute in the operating system.
The base directory to start the OS command.
String of the output of the command.