![](/img/trans.png)
[英]How to convert c# code to vb.net. Error occurred in getting numeric value of a character
[英]I have a C# code. I want to convert it in vb.net. But I am unable to convert unsafe and fixed key word
不安全且已在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
}
這是我的努力,但我不滿意
<StructLayout(LayoutKind.Sequential, Pack:=1)>
Public Structure SGDeviceInfoParam
Private Const SGDEV_SN_LEN As Integer = 15
' Device Serial Number Length
Public DeviceID As UInt32
' Device Serial Number, Length of SN = 15
Public ComPort As UInt32
' Parallel device=>PP address, USB device=>USB(0x3BC+1)
Public ComSpeed As UInt32
' Parallel device=>PP mode, USB device=>0
Public ImageWidth As UInt32
' Image Width
Public ImageHeight As UInt32
' Image Height
Public Contrast As UInt32
' 0 ~ 100
Public Brightness As UInt32
' 0 ~ 100
Public Gain As UInt32
' Dependent on each device
Public ImageDPI As UInt32
' DPI
Public FWVersion As UInt32
End Structure
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.