我希望能够声明一个数据管理单元的方法具有以下签名

type
  TLoginInfo = record
    Username: string;
    Password: string;
    LastLogged: DateTime;
  end;

function GetLoginInfo(const UserId: Integer): TLoginInfo;

当我尝试调用它,它说的 TLoginInfo 不是众所周知的。

有帮助吗?

其他提示

的记录存储到流和流传递到DataSnap方法

//在服务器侧

function GetLoginInfo(const UserId: Integer): TStream;
begin
  Result := TMemoryStream.Create;
  Result.Write( loginRec, SizeOf(TLoginInfo) )
  Result.Seek(0, TSeekOrigin.soBeginning);
end;

//在客户端

procedure TfrmMain.getLogInto( sUser: string);
var
  AStr : TStream;
  loginRec : TLoginInfo;
begin
//  cycleConnection;

  with TMethodsClient.Create( SQLConn.DBXConnection, False ) do begin

    AStr := GetLoginInfo( sUser );
    AStr.Read( loginRec, SizeOf(TLoginInfo) )
    Free;
  end;

  FreeAndNil(AStr);
end;
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top