TsgcWebSocketFirewall › Methods › LoadBansFromFile
Restores the active ban list from a file previously written by SaveBansToFile, so bans survive process restarts.
procedure LoadBansFromFile(const aFileName: string);
| Name | Type | Description |
|---|---|---|
aFileName | const string | Path to the ban file to load. Missing or empty files are ignored without raising an exception. |
Each record stores the IP, expiry timestamp and escalation level. Bans whose expiry has already passed are dropped during loading, so only still-valid bans are re-applied. The operation merges with the in-memory list; call ClearBans first if you need a clean replacement.
// restore bans at start-up
sgcWebSocketFirewall1.LoadBansFromFile('bans.dat');