以下のようなクラスがあります。
function Request()
{
this.CompanyId;
this.Password;
this.SessionId;
this.UserId;
this.UserName;
}
オブジェクトを作成し、オブジェクトのバイト配列を取得したい。
var request = new Request();
request.UserName = GlobalProcess.SessionInfo.Server.UserName;
request.Password = GlobalProcess.SessionInfo.Server.Password;
request.CompanyId = GlobalProcess.SessionInfo.SelectedDatabase.CompanyId.toString();
request.UserId = GlobalProcess.SessionInfo.UserId.toString();
request.SessionId = GlobalProcess.SessionInfo.SessionId.toString();
var requestbinary = GetByte(request);
console.log(requestbinary);
私のGetByte
機能は次のとおりです。
function GetByteArrayFromStringArray(parameter)
{
var mainbytesArray = [];
for (var i = 0; i < parameter.length; i++)
mainbytesArray.push(parameter.charCodeAt(i));
return mainbytesArray;
}
コンソールで、空の配列を取得します。私は何を間違っていますか?