开发者

How do I change the format of a field in an OpenIso8583.Net message

开发者 https://www.devze.com 2023-03-29 23:34 出处:网络
For example, the default format for field 128 in OpenIso8开发者_StackOverflow社区583Rev93 is Fixed Hex 8.How would I change it to Fixed Hex 16.You need to extend Iso8583Rev93 and override the template

For example, the default format for field 128 in OpenIso8开发者_StackOverflow社区583Rev93 is Fixed Hex 8. How would I change it to Fixed Hex 16.


You need to extend Iso8583Rev93 and override the template class in the constructor.

public class Iso8583Extended : Iso8583Rev93
{
    private static readonly Template ExtendedTemplate;
    static Iso8583Extended()
    {
        ExtendedTemplate = new Template();
        ExtendedTemplate[Bit._128_MAC] = FieldDescriptor.AsciiFixed(16, FieldValidators.Hex);
    }

    public Iso8583Extended():base(ExtendedTemplate)
    {
    }
}

Will do the job.

0

精彩评论

暂无评论...
验证码 换一张
取 消