mirror of
https://github.com/fergalmoran/DnsServer.git
synced 2025-12-22 09:29:50 +00:00
MainApplicationContext: Updated DashboardMenuItem_Click() to support new dns config file format.
This commit is contained in:
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user