Search Results for

    Show / Hide Table of Contents

    Class ParseResult

    Represents the result of parsing structured data, containing the parsed elements and any parsing issues.

    Inheritance
    System.Object
    ParseResult
    Namespace: IronBarCode
    Assembly: IronBarCode.dll
    Syntax
    public class ParseResult : Object

    Parsing a structured barcode payload into named fields hands a developer a ParseResult. A raw Code 128 or GS1 value carries several application-identifier fields packed together, and parsing breaks that string into typed pieces while recording anything that did not check out. The result object is what a developer reads to decide whether the parse can be trusted and to reach the individual fields it produced.

    The headline is Success, a flag that says whether parsing completed cleanly, paired with Errors and Warnings, both List<string>, that explain any problems found. A developer checks Success first, then surfaces the diagnostics when it is false. The parsed data itself lives in Elements, a List<ParsedElement> where each entry holds one recognized field with its own validity state.

    The remaining members add context. FormattedString renders the parsed payload in a readable form suited to logs or a display field, and CharacterSetSummary describes the character sets the source data used. HasEncodingInfo reports whether encoding detail is available, and when it is, EncodingInfo returns the Code128EncodingInfo that documents how the symbol was packed. Checking HasEncodingInfo before reading EncodingInfo avoids a null reference when a parse produced no encoding report. Treat the result as read-only output describing one parse, iterating Elements for the data and consulting Errors for what went wrong. Because the diagnostics are separated from the data, an application can accept the valid fields and report the failed ones rather than discarding the whole read. The output data formats how-to shows how to present parsed results, and the checksum and format validation how-to covers validating the underlying values.

    using IronBarCode;
    
    if (result.Success)
        foreach (ParsedElement element in result.Elements)
            Console.WriteLine($"{element.Identifier}: {element.Data}");
    else
        Console.WriteLine(string.Join("; ", result.Errors));

    The reading barcodes tutorial covers the full read and parse workflow.

    Constructors

    ParseResult()

    Declaration
    public ParseResult()

    Properties

    CharacterSetSummary

    Gets a summary of the character sets used in the barcode encoding.

    Declaration
    public string CharacterSetSummary { get; }
    Property Value
    Type Description
    System.String

    Elements

    List of parsed elements.

    Declaration
    public List<ParsedElement> Elements { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.List<ParsedElement>

    EncodingInfo

    Code 128 encoding information showing how the barcode is physically encoded. Only populated when encoding analysis is requested.

    Declaration
    public Code128EncodingInfo EncodingInfo { get; set; }
    Property Value
    Type Description
    Code128EncodingInfo

    Errors

    List of errors encountered during parsing.

    Declaration
    public List<string> Errors { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.List<System.String>

    FormattedString

    Formatted string representation of the parsed data.

    Declaration
    public string FormattedString { get; set; }
    Property Value
    Type Description
    System.String

    HasEncodingInfo

    Gets whether encoding analysis has been performed.

    Declaration
    public bool HasEncodingInfo { get; }
    Property Value
    Type Description
    System.Boolean

    Success

    Indicates whether the parsing was successful.

    Declaration
    public bool Success { get; set; }
    Property Value
    Type Description
    System.Boolean

    Warnings

    List of warnings encountered during parsing.

    Declaration
    public List<string> Warnings { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.List<System.String>
    ☀
    ☾
    Downloads
    • Download with Nuget
    • Start for Free
    In This Article
    Back to top
    Install with Nuget
    IronBarcode_for_dotnet_log2o
    Blue key in circleGet started for FREE
    No credit card required
    Test in a live environment

    Test in production without watermarks.
    Works wherever you need it to.

    Fully-functional product

    Get 30 days of fully functional product.
    Have it up and running in minutes.

    24/5 technical support

    Full access to our support engineering team during your product trial

    Grey key in circleGet started for FREE
    The trial form was submitted successfully.
    Calendar in circleBook Free Live Demo
    No contact, no card details, no commitments Book a 30-minute, personal demo.
    Here's what to expect:

    A live demo of our product and its key features

    Get project specific feature recommendations

    All your questions are answered to make sure you have all the information you need. (No commitment whatsoever.)

    Grey key in circleBook Free Live Demo
    Your booking has been completed Check your e-mail for confirmation
    Support Team Member 6 related to The C# PDF Library Support Team Member 14 related to The C# PDF Library Support Team Member 4 related to The C# PDF Library Support Team Member 2 related to The C# PDF Library
    Online 24/5
    Need help? Our sales team would be glad to help you.
    Try the Enterprise Trial
    ironpdf_for_dotnet_log2o
    Key in blue circle
    Get your free 30-day Trial Key instantly.
    bullet_checkedNo credit card or account creation required
    Key in blue circle
    Get your free 30-day Trial Key instantly.
    Blue key in circleNo credit card or account creation required
    Green Check in orange circle
    The trial form was submitted successfully.
    badge_greencheck_in_yellowcircle
    Thank you for starting a trial

    Please check your email for the trial license key.

    If you don’t receive an email, please start a live chat or email support@ironsoftware.com

    Install with NuGet
    View Licensing
    • Logo Aetna
    • Logo NASA
    • Logo GE
    • Logo Porsche
    • Logo USDA
    • Logo Qatar
    Join Millions of Engineers who’ve tried IronBarcode