Fixed length strings or structures in C#

后端 未结 3 2064
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-15 02:32

I need to create a structure or series of strings that are fixed lenght for a project I am working on. Currently it is written in COBOL and is a communication application. I

3条回答
  •  离开以前
    2021-01-15 02:59

    Add the MarshalAs tag to your structure. Here is an example:

     _
    Public Structure OSVERSIONINFO
        Public dwOSVersionInfoSize As Integer
        Public dwMajorVersion As Integer
        Public dwMinorVersion As Integer
        Public dwBuildNumber As Integer
        Public dwPlatformId As Integer
    
         _
        Public szCSDVersion As String
    End Structure
    

    http://bytes.com/groups/net-vb/369711-defined-fixed-length-string-structure

提交回复
热议问题