c#代码:public static bool ReadPort(int nPort)
{
      int nState=0;
     int Ret;
     Ret=__ReadPort(ref nState);
    if (((nState >>nPort) &0x01) >0)         --关键是这段转换成delphi 是怎样写的,0x01是16进制
        return true;
    else
       return false;}

解决方案 »

  1.   

      if (((nState >>nPort) &0x01) >0)   
    delphi 写法
    if ( (nState shr nPort) and $01)>0 then
      

  2.   

    看帮助,看那是什么操作符,就用Delphi中的操作符替换就可以了
      

  3.   

    public static bool ReadPort(int nPort)
    {
          int nState=0;
         int Ret;
         Ret=__ReadPort(ref nState);
        if (((nState >>nPort) &0x01) >0)         --关键是这段转换成delphi 是怎样写的,0x01是16进制
            return true;
        else
           return false;}function ReadPort(port:Integer);
    var
      nState:Integer;
      Ret:Integer;
    begin
      Ret := _ReadPort(nState);
      result := ((nState shr port) and $1)>0;
    end;