Method | Description | |
---|---|---|
CreateDirectory ( string path ) : System.Boolean |
Create a directory at a given web path.
|
|
DeleteDirectory ( string directory ) : String |
Deletes a directory, and any files and subdirectories it contains. Directory passed is in standard web form (e.g. "/temp").
|
|
DeleteFiles ( string fileSpec ) : |
Deletes a single file immediately.
|
|
DeleteFiles ( string path, string fileSpec ) : |
Deletes file(s) immediately.
|
|
DeleteFiles ( string path, string filter, PathOptions options, System age ) : |
Deletes file(s) from a directory, based on age.
|
|
DeleteFiles ( string path, string fileSpec, bool includeSpecial ) : |
Deletes file(s) immediately.
|
|
DirectoryExists ( string path ) : System.Boolean |
Determines if a directory exists at a given web path.
|
|
FileExists ( string path ) : System.Boolean |
Determines if a file exists at a given web path.
|
|
GetFileExtension ( string fileName ) : String |
Retrieve a file's extension, without the period.
|
|
GetFileSize ( string path ) : System.Int64 |
Get the file size in bytes of a file on disk.
|
|
GetFiles ( string path, string filter ) : |
Reads filenames from a directory and returns an ArrayList.
|
|
GetFiles ( string path, string filter, PathOptions options ) : |
Reads filenames from a directory and returns an ArrayList.
|
|
GetFolders ( string path ) : String[] |
Reads directory names from a gievn path and returns a string array.
|
|
MakeUniqueFilename ( string ext ) : String |
Creates a unique, cryptic filename (based on GUID) for use in temporary file manipulation.
|
|
MakeValidFileName ( string fileName ) : String |
Replaces any invalid characters in a file name with underscores, returning the filtered filename.
|
|
MapPath ( string path ) : string |
Transforms relative path to exact path for web and console apps.
|
|
ReadFile ( string filename ) : String |
Reads the contents of a text file.
|
|
WriteFile ( string filename, string content ) : String |
Writes a string to a text file.
|
Method | Description | |
---|---|---|
H3Storage ( ) : System |
public static CreateDirectory ( string path ) : System.Boolean | ||
path | string | Path and new directory (e.g. "/downloads/newdir"). |
return | System.Boolean |
public static DeleteDirectory ( string directory ) : String | ||
directory | string | Directory to delete (as "/temp"). Passing an empty string will delete the current working directory! |
return | String |
public static DeleteFiles ( string fileSpec ) : |
||
fileSpec | string | Web-formatted path with file name. |
return |
public static DeleteFiles ( string path, string fileSpec ) : |
||
path | string | Web-formatted path where the files exist. |
fileSpec | string | String filename wildcard (*.* is assumed by default). Separate multiple filespecs with a bar character (e.g. "*.gif|*.jpg"). |
return |
public static DeleteFiles ( string path, string filter, PathOptions options, System age ) : |
||
path | string | Web-formatted path to the files or a full path and filename to delete a single file (the later ignores any age params). |
filter | string | String filename wildcard (*.* is assumed by default). Separate multiple filespecs with a bar character (e.g. "*.gif|*.jpg"). |
options | PathOptions | options for file inclusion (PathOptions.Hidden | PathOptions.System) deletes all files, including hidden and system files. |
age | System | DateTime object; files older than this (creation date; within 1 minute) are deleted. |
return |
public static DeleteFiles ( string path, string fileSpec, bool includeSpecial ) : |
||
path | string | Web-formatted path where the files exist. |
fileSpec | string | String filename wildcard (*.* is assumed by default). Separate multiple filespecs with a bar character (e.g. "*.gif|*.jpg"). |
includeSpecial | bool | Set to true to deleted hidden/system files. |
return |
public static DirectoryExists ( string path ) : System.Boolean | ||
path | string | Path to a directory (e.g. "/downloads/"). |
return | System.Boolean |
public static FileExists ( string path ) : System.Boolean | ||
path | string | Path to a file (e.g. "/downloads/file.jpg"). |
return | System.Boolean |
public static GetFileExtension ( string fileName ) : String | ||
fileName | string | File name to parse. |
return | String |
public static GetFileSize ( string path ) : System.Int64 | ||
path | string | Path to a file (e.g. "/downloads/file.jpg"). |
return | System.Int64 |
public static GetFiles ( string path, string filter ) : |
||
path | string | Web-formatted path to the files. |
filter | string | String filename wildcard (*.* is assumed by default). /// Separate multiple filespecs with a bar character (e.g. "*.gif|*.jpg") |
return |
public static GetFiles ( string path, string filter, PathOptions options ) : |
||
path | string | Web-formatted path to the files. |
filter | string | String filename wildcard (*.* is assumed by default). /// Separate multiple filespecs with a bar character (e.g. "*.gif|*.jpg") |
options | PathOptions | options for returned files inclusion, et al. /// (e.g. (PathOptions.Hidden | PathOptions.System | PathOptions.Path) returns all files, /// including hidden and system files, and the filename includes the full path). |
return |
public static GetFolders ( string path ) : String[] | ||
path | string | Web-formatted parent path to examine. |
return | String[] |
public static MakeUniqueFilename ( string ext ) : String | ||
ext | string | File extension to append to the name, without leading period. |
return | String |
public static MakeValidFileName ( string fileName ) : String | ||
fileName | string | File name to filter. |
return | String |
public static MapPath ( string path ) : string | ||
path | string | Web-style path to a file (e.g. "/downloads/file.jpg"). |
return | string |
public static ReadFile ( string filename ) : String | ||
filename | string | Web-formatted path and file name to read. |
return | String |
public static WriteFile ( string filename, string content ) : String | ||
filename | string | Web-formatted path and file name to save. |
content | string | String to save into file. |
return | String |