LAUREL BRIDGE

LaurelBridge.DCFExamples.DcfInfo Namespace

DICOM Connectivity Framework V3.4
The DcfInfo example allows the user to get the Activation Request Code and other properties related to DCF installation.
Classes

  ClassDescription
Public classInfoUtils
Utility methods used by DcfInfo.
Public classProgram
Example that demonstrates how to get DCF version, license and activation properties.
Remarks

Supported OS Platforms:

  • Windows - .Net Framework 4.7.2 64-bit and 32-bit
  • Windows - .Net Core 2.1 64-bit and 32-bit
  • Linux - .Net Core 2.1 64-bit

Examples

DcfInfo Sample Code
public class Program
{
    /// <summary>
    /// Main entry point.
    /// </summary>
    /// <param name="args">unused</param>
    public static void Main(string[] args)
    {
        Console.WriteLine("This is the Laurel Bridge DCF(TM) DICOM Connectivity Framework(TM), v{0}", DCFVersion.Version);
        Console.WriteLine("{0}Current Platform Characteristics:", Environment.NewLine);
        Console.WriteLine("=================================");
        Console.WriteLine("OS Version: {0}, Processor: {1}", Environment.OSVersion, IntPtr.Size == 8 ? "64bit" : "32bit");
        Console.WriteLine("DcfInfo Target Framework: {0}", InfoUtils.GetTargetAssemblyFramework(Assembly.GetExecutingAssembly()));
        Console.WriteLine("DCF Library Target Framework: {0}", InfoUtils.GetTargetAssemblyFramework(Assembly.GetAssembly(typeof(Framework))));

        Console.WriteLine("{0}DCF Version Information:", Environment.NewLine);
        Console.WriteLine("========================");
        Console.WriteLine("DCF Version: {0}", DCFVersion.Version);
        Console.WriteLine("Build Number: {0}", DCFVersion.BuildNumber);
        Console.WriteLine("DCF Platform: {0}", DCFVersion.Platform);
        Console.WriteLine("DCF Supported Target Framework / Runtime Identifiers:");
        foreach (string supportedTargetRid in DCFVersion.SupportedTargetRids)
        {
            Console.WriteLine(supportedTargetRid);
        }

        Console.WriteLine("{0}DCF DICOM UID Information:", Environment.NewLine);
        Console.WriteLine("==========================");
        Console.WriteLine("Software UID Base: {0}", DCFVersion.LBSRoot);
        Console.WriteLine("Default UID Base: {0}", DCFVersion.DCFUidBase);
        Console.WriteLine("Implementation Version UID: {0}", DCFVersion.DCFImplementationUid);
        Console.WriteLine("Implementation Version Name: {0}", DCFVersion.DCFImplementationVersionName);

        Console.WriteLine("{0}DCF License Information:", Environment.NewLine);
        Console.WriteLine("======================== ");

        try
        {
            Framework.CheckLicense();
            string license = File.ReadAllText(Framework.LicenseFilePath);
            Console.WriteLine("{0}", license);
            Console.WriteLine("License status:");
            Console.WriteLine("===============");
            Console.WriteLine("valid");
        }
        catch (Exception e)
        {
            Console.WriteLine("{0}License status:", Environment.NewLine);
            Console.WriteLine("===============");
            Console.WriteLine("invalid");
            Console.WriteLine(e.Message);
            Environment.ExitCode = 1;
        }

        // MAC
        Console.WriteLine("{0}Device MAC(s) found:", Environment.NewLine);
        Console.WriteLine("====================");
        InfoUtils.GetMacAddresses().ForEach(Console.WriteLine);

        // IP
        Console.WriteLine("{0}IP Address(es) found:", Environment.NewLine);
        Console.WriteLine("=====================");
        InfoUtils.GetIpV4Addresses().ForEach(Console.WriteLine);

        // ARC
        Console.WriteLine("{0}Activation Request Code:", Environment.NewLine);
        Console.WriteLine("========================");
        Console.WriteLine("{0}", Framework.GetLicenseActivationRequestCode());

        // The build host info
        Console.WriteLine("{0}Characteristics of this binary:", Environment.NewLine);
        Console.WriteLine("===============================");
        Console.WriteLine("{0}", DCFVersion.BuildInfo);

        // C# info
        Console.WriteLine("{0}Compiled: {1}", Environment.NewLine, DCFVersion.BuildDate);
        Console.WriteLine("{0}", DCFVersion.CscInfo);
        Console.WriteLine("{0}", DCFVersion.MsBuildInfo);

        // LBS info
        Console.WriteLine("{0}Copyright Laurel Bridge Software, Inc.", Environment.NewLine);
        Console.WriteLine("All rights reserved.  See distributed license file.");
        Console.WriteLine("Contact: info@laurelbridge.com");
        Console.WriteLine("         www.laurelbridge.com");

        if (System.Diagnostics.Debugger.IsAttached)
        {
            Console.Write("Press any key to continue . . . ");
            Console.ReadKey();
        }
    }
}