MainApplicationContext: Updated DashboardMenuItem_Click() to support new dns config file format.

This commit is contained in:
Shreyas Zare
2022-09-18 18:17:55 +05:30
parent 8fb898d630
commit 70e5b1638c

View File

@@ -592,11 +592,15 @@ namespace DnsServerSystemTrayApp
BinaryReader bR = new BinaryReader(fS); BinaryReader bR = new BinaryReader(fS);
if (Encoding.ASCII.GetString(bR.ReadBytes(2)) != "DS") //format if (Encoding.ASCII.GetString(bR.ReadBytes(2)) != "DS") //format
throw new InvalidDataException("DnsServer config file format is invalid."); throw new InvalidDataException("DNS Server config file format is invalid.");
int version = bR.ReadByte(); int version = bR.ReadByte();
if (version > 1) if (version >= 28)
{
port = bR.ReadInt32();
}
else if (version > 1)
{ {
string serverDomain = bR.ReadShortString(); string serverDomain = bR.ReadShortString();
port = bR.ReadInt32(); port = bR.ReadInt32();