# IniDocument.SaveTo

Kind: Method  
Namespace: `Sisk.IniConfiguration.Core`  
Assembly: `Sisk.IniConfiguration.Core.dll`  
Source: https://docs.sisk-framework.org/api/Sisk.IniConfiguration.Core.IniDocument.SaveTo.html

## SaveTo(string, Encoding?) {#Sisk_IniConfiguration_Core_IniDocument_SaveTo_System_String_System_Text_Encoding_}

Saves the INI document to a file.

```csharp
public void SaveTo(string filePath, Encoding? encoding = null)
```

### Parameters

`filePath` [string](https://learn.microsoft.com/dotnet/api/system.string)

The path to the file where the INI document will be saved.

`encoding` [Encoding](https://learn.microsoft.com/dotnet/api/system.text.encoding)?

The encoding to use when writing the file. Defaults to [Default](https://learn.microsoft.com/dotnet/api/system.text.encoding.default).

## SaveTo(Stream, Encoding?) {#Sisk_IniConfiguration_Core_IniDocument_SaveTo_System_IO_Stream_System_Text_Encoding_}

Saves the INI document to a stream.

```csharp
public void SaveTo(Stream stream, Encoding? encoding = null)
```

### Parameters

`stream` [Stream](https://learn.microsoft.com/dotnet/api/system.io.stream)

The stream to which the INI document will be written.

`encoding` [Encoding](https://learn.microsoft.com/dotnet/api/system.text.encoding)?

The encoding to use when writing to the stream. Defaults to [Default](https://learn.microsoft.com/dotnet/api/system.text.encoding.default).
