SaveFile(String,String) Method
- Last UpdatedNov 06, 2025
- 1 minute read
Function to save data to a specified file, overwriting the file if it already exists This override saves text data to the file Throw an exception if any error occurs (eg dir does not exist)
'Declaration
Public Overloads Shared Function SaveFile( _
ByVal completeFilePath As String, _
ByVal contents As String _
) As FileInfo
'Usage
Dim completeFilePath As String
Dim contents As String
Dim value As FileInfo
value = FileHelper.SaveFile(completeFilePath, contents)
public static FileInfo SaveFile(
string completeFilePath,
string contents
)
Parameters
- completeFilePath
- The complete filename including its path as a string to save the data to
- contents
- The data to be saved in the file as a string
Return Value
Returns a FileInfo object for the newly created file