W
wxpub
Unregistered / Unconfirmed
GUEST, unregistred user!
发送图片文件
发送格式要求'Jpg_J01|jpg文件名|'+文件
说明:strCondition='Jpg_J01|文件名|'
filename=文件路径/文件名
var
JpgBuff,PConditionchar;
JpgFile:TmemoryStream;
size,len:integer;
begin
len:=length(strCondition);
PCondition:= pchar(strCondition);
JpgFile:= TmemoryStream.Create;
JpgFile.LoadFromFile(filename);
getmem(JpgBuff,JpgFile.Size+len);
JpgFile.Position:=0;
JpgFile.WriteBuffer(PCondition,len);
JpgFile.Read(JpgBuff^,JpgFile.Size);
size:=JpgFile.Size;
ClientSocket1.Socket.SendBuf(JpgBuff[0],size);
//请问能否转换为string类型,如何转换。
ClientSocket1.Socket.Sendtext();
end;
发送格式要求'Jpg_J01|jpg文件名|'+文件
说明:strCondition='Jpg_J01|文件名|'
filename=文件路径/文件名
var
JpgBuff,PConditionchar;
JpgFile:TmemoryStream;
size,len:integer;
begin
len:=length(strCondition);
PCondition:= pchar(strCondition);
JpgFile:= TmemoryStream.Create;
JpgFile.LoadFromFile(filename);
getmem(JpgBuff,JpgFile.Size+len);
JpgFile.Position:=0;
JpgFile.WriteBuffer(PCondition,len);
JpgFile.Read(JpgBuff^,JpgFile.Size);
size:=JpgFile.Size;
ClientSocket1.Socket.SendBuf(JpgBuff[0],size);
//请问能否转换为string类型,如何转换。
ClientSocket1.Socket.Sendtext();
end;