请问如何将下面的结构体转成c#:
typedef struct ft_program_data {
WORD VendorId; // 0x0403
WORD ProductId; // 0x6001
char *Manufacturer; // "FTDI"
char *ManufacturerId; // "FT"
char *Description; // "USB HS Serial Converter"
char *SerialNumber; // "FT000001" if fixed, or NULL
WORD MaxPower; // 0 < MaxPower <= 500
WORD PnP; // 0 = disabled, 1 = enabled
WORD SelfPowered; // 0 = bus powered, 1 = self powered
WORD RemoteWakeup; // 0 = not capable, 1 = capable
//
// Rev4 extensions
//
UCHAR Rev4; // non-zero if Rev4 chip, zero otherwise
UCHAR IsoIn; // non-zero if in endpoint is isochronous
UCHAR IsoOut; // non-zero if out endpoint is isochronous
UCHAR PullDownEnable; // non-zero if pull down enabled
UCHAR SerNumEnable; // non-zero if serial number to be used
UCHAR USBVersionEnable; // non-zero if chip uses USBVersion
WORD USBVersion; // BCD (0x0200 => USB2)
} FT_PROGRAM_DATA, *PFT_PROGRAM_DATA;

解决方案 »

  1.   

    struct FT_PROGRAM_DATA
    {
    public UInt16 VendorId;
    public UInt16 ProductId;
    public string Manufactuer;
    public string ManufacturerId;
    public string Description;
    public string SerialNumber;
    public UInt16 MaxPower;
    public UInt16 PnP;
    public UInt16 SelfPowered;
    public UInt16 RemoteWakeup;
    //...
    public byte Rev4;
    public byte IsoIn;
    public byte IsoOut;
    public byte PullDownEnable;
    public byte SerNumEnable;
    public byte USBVersionEnable;
    public UInt16 USBVersion;
    }指针类型的话 .. 用的时候再翻译..