Utility.cs
/// <summary>
/// Saves the provided contents to the provided path as a file. 
/// </summary>
/// <param name="path">The path of the file.</param>
/// <param name="contents">The contents to save as a file.</param>
Saves the provided contents to the provided path as a file.
Saves the provided contents to the provided path as a file .
public void SaveFile(string path, string contents)
        {
            try
            {
                if (!string.IsNullOrEmpty(path))
                {
                    File.WriteAllText(path, contents);
                }
                else
                {
                    throw new Exception("Cannot save file, because path is not provided.");
                }
            }
            catch (Exception ex)
            {
                this.HandleException(ex);
            }
        }
public void SaveFile ( string path , string contents ) { try { if ( ! string . IsNullOrEmpty ( path ) ) { File . WriteAllText ( path , contents ) ; } else { throw new Exception ( " " ) ; } } catch ( Exception ex ) { this . HandleException ( ex ) ; } }
Saves the provided contents to the provided path as a file.
Saves the provided contents to the provided path as a file .
path
string
The path of the file.
The path of the file .
contents
string
The contents to save as a file.
The contents to save as a file .