Z
zyh888
Unregistered / Unconfirmed
GUEST, unregistred user!
function BytesToStr(mBytes: array of Byte): string;
var
I: Integer;
begin
Result := '';
for I := Low(mBytes) to High(mBytes) do
Result := Result + Chr(mBytes)
end;
function StrToHexStr(s : String): String;
var
Index : Integer;
begin
Result := '';
for Index :=1 to length(s) do
begin
Result := Result + IntToHex(ord(s[Index]),2);
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
b : array[1..8] of byte;
s : string;
begin
b[1] := $68;
b[2] := $01;
b[3] := $00;
b[4] := $00;
b[5] := $00;
b[6] := $00;
b[7] := $00;
b[8] := $68;
s := BytesToStr(b);
// s := 'h'#1#0#0#0#0#0'h'
c := StrToHexStr(s);
//c = 6801000000000068
end;
出现#0就默认的结束,要如何将'h'#1#0#0#0#0#0'h'这整段字符写入到Oracle varchar2的字段里面去,而且在读回这个字段的时候,可以转换回6801000000000068
用什么方法,请高手指教.
var
I: Integer;
begin
Result := '';
for I := Low(mBytes) to High(mBytes) do
Result := Result + Chr(mBytes)
end;
function StrToHexStr(s : String): String;
var
Index : Integer;
begin
Result := '';
for Index :=1 to length(s) do
begin
Result := Result + IntToHex(ord(s[Index]),2);
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
b : array[1..8] of byte;
s : string;
begin
b[1] := $68;
b[2] := $01;
b[3] := $00;
b[4] := $00;
b[5] := $00;
b[6] := $00;
b[7] := $00;
b[8] := $68;
s := BytesToStr(b);
// s := 'h'#1#0#0#0#0#0'h'
c := StrToHexStr(s);
//c = 6801000000000068
end;
出现#0就默认的结束,要如何将'h'#1#0#0#0#0#0'h'这整段字符写入到Oracle varchar2的字段里面去,而且在读回这个字段的时候,可以转换回6801000000000068
用什么方法,请高手指教.