结构如下:
struct SERVER_INFO{
  char bProxy;
  char ip[16];
  unsigned short port;
  union{
    struct{char usr[16]; /* valid length : 15 bytes */
    char psd[16]; /* valid length : 15 bytes */
    }tin;
   struct{long state; /* 0-dead, 1-active, -1: invalid socket */
 long idleSTCount;
          long actSTCount;
 long reserved[5];
 }tout;
  }info; 
};

解决方案 »

  1.   

    type
    ttin=record
       usr:array[0..16]of char;
       psd:array[0..15]of char;
    end;ttout=record
       state:longint;
       idleSTCount:longint;
       actSTCount:longInt;
       reserved:array[0..5]of longint;
    end;tinfo=record
      case Integer of
      0:tin:ttint;
      1:tout:ttout;
    end;SERVER_INFO=record
      bProxy:char;
      ip:array[0..15]of char
      prot:word;
      info:Tinfo;
    end;
      

  2.   

    建议使用紧凑式定义记录RecordName=packed record
      

  3.   

    Ttin = Record
        usr:array[0..15] of char ;
        psd:array[0..15] of char ;
      end;
      Ttout = Record
        state : longint ;
        idleSTCount : longint ;
        actSTCount : longint ;
        reserved : array[0..4] of longint ;
      end;
      Tinfo=record
        case Integer of
        0:(tin:Ttin);
        1:(tout:Ttout)
      end;
      SERVER_INFO = Record
        bProxy : char ;
        ip : array[0..15] of char ; 
        port : Word ;
        info:Tinfo ;
      end;