AdifNet 1.8.6

dotnet add package AdifNet --version 1.8.6                
NuGet\Install-Package AdifNet -Version 1.8.6                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AdifNet" Version="1.8.6" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AdifNet --version 1.8.6                
#r "nuget: AdifNet, 1.8.6"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install AdifNet as a Cake Addin
#addin nuget:?package=AdifNet&version=1.8.6

// Install AdifNet as a Cake Tool
#tool nuget:?package=AdifNet&version=1.8.6                

ADIF.NET

A fully featured ADIF/ADX parser and generator for .NET

Introduction

Amateur Data Interchange Format (ADIF) is an open standard for exchanging ham radio on-air contacts between different platforms and systems.

The full standard can be found at the official ADIF web site.

This library parses and generates files in both ADIF and ADX formats.

Example Usage

To parse an ADIF file stored on your local machine, instantiate the AdifParser class, load the file, and call the Parse method:

var parser = new AdifParser();
parser.LoadFile(@"C:\Users\username\Desktop\contacts.adi");
var adifData = parser.Parse();

To create a new QSO record, instantiate the AdifQso class and call methods to apply data to the QSO:

var newQso = new AdifQso();
newQso.SetCall("K9BZM");
newQso.SetDateTimeOn("01/08/2025 13:46:39", "MM/dd/yyyy HH:mm:ss");
newQso.SetBand("20m");
newQso.SetMode("SSB", "USB");
newQso.SetOperator("K0UOG");
newQso.SetName("Steve");

Console.WriteLine(newQso.ToString("A"));

The above code outputs the following text to the console:

<CALL:5>K9BZM <QSO_DATE:8>20250108 <TIME_ON:6>134639 <BAND:3>20m <MODE:3>SSB <SUBMODE:3>USB <OPERATOR:5>K0UOG <NAME:5>Steve <EOR>

SQL Adapter

This library also provides the AdifSqlAdapter class for interacting with QSO data stored in a database. Any database framework that implements the System.Data.IDbConnection and associated interfaces can work with the adapter class.

Each QSO is assigned a unique ID (a Guid with the dashes removed), which is stored in an application-defined field named APP_ADIFNET_QSOUNIQID.

The SQL adapter relies on mapping ADIF tag names to columns in the database, as defined by an instance of the AdifColumnMappings class. That class provides two default mappings:

  • AdifColumnMappings.DefaultMinimum, which maps the CALL, OPERATOR, QSO_DATE, TIME_ON, BAND, and MODE tags to database fields of the same name
  • AdifColumnMappings.All, which maps all ADIF tags to database fields with the same names as each tag

In both cases, the application-defined tag containing the QSO unique ID is included in the mapping.

To store the newQso object in a MySQL database table named QSOs, instantiate the adapter as follows:

var mysqlConnection = new MySqlConnection("server=localhost;user=user;database=adif;password=password;");

var sqlAdapter = new AdifSqlAdapter(mysqlConnection, "QSOs", SqlReservedWordEscape.Backticks, SqlParameterPrefix.Question);

sqlAdapter.Insert(newQso);

var qsos = sqlAdapter.RetrieveAll();

The newly saved QSO will now be included in the QSO collection stored in the variable qsos.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.8.6 70 1/20/2025
1.8.5 65 1/20/2025
1.8.3 54 1/12/2025
1.8.3-beta 58 1/12/2025