Upgrade Nuget
大石头 authored at 2024-11-20 14:35:47
383.00 B
SmartA2
namespace SmartA2;

/// <summary>输入口</summary>
public class InputPort
{
    /// <summary>文件路径</summary>
    public String FileName { get; set; }

    FileStream _stream;
    Stream GetStream() => _stream ??= File.OpenRead(FileName);

    /// <summary>读取开关值</summary>
    /// <returns></returns>
    public Boolean Read() => GetStream().ReadByte() == '1';
}