我有一个C#代码。我想在vb.net中转换它。但我无法转换不安全和固定的关键字

时间:2018-06-04 07:10:04

标签: c# vb.net fixed unsafe

Unasafe并在vb.net中修复

 [StructLayout(LayoutKind.Sequential, Pack = 1)]
    public unsafe struct SGDeviceInfoParam
    {
        private const int SGDEV_SN_LEN = 15;        // Device Serial Number Length

        public UInt32 DeviceID; 

**这是问题** // 0 - 9

public fixed Byte DeviceSN[SGDEV_SN_LEN + 1]; // Device Serial Number, Length of SN = 15
            public UInt32 ComPort;                      // Parallel device=>PP address, USB device=>USB(0x3BC+1)
            public UInt32 ComSpeed;                     // Parallel device=>PP mode, USB device=>0 
            public UInt32 ImageWidth;                   // Image Width
            public UInt32 ImageHeight;                  // Image Height
            public UInt32 Contrast;                     // 0 ~ 100
            public UInt32 Brightness;                   // 0 ~ 100
            public UInt32 Gain;                         // Dependent on each device
            public UInt32 ImageDPI;                     // DPI
            public UInt32 FWVersion;                    // FWVersion
        }

1 个答案:

答案 0 :(得分:0)

这是我的努力,但我不满意

ThreadPoolExecutor