我不想用读写文件的方法,所以不能用TMemoryStream的Savetofile,然后再StringList.LoadFromFile取出的方法。我用一个s:TStrings,s.LoadFromStream,然后StringList.Text:=s.Text也不行。请问各位高手有什么方法?多谢。
解决方案 »
- 请教 关于CRC校验算法
- .rm文件的播放问题 大家帮忙!!
- 用ADO 连接数据库的问题
- Dephi7中有没有与ValueListEditors类似,但列数大于二的控件?
- 我安装了Delphi7,为什么里面没有ModelMaker?请教
- 能否在父控件enable=false的情况下,使得子控件能够操作啊?
- 送分,谁来关心一下我的贴子,我就送分!
- 想用socket但不想用sendstream发图片怎么办?
- 我想要编写一个程序能够检测到当前系统下所有的进程
- 为啥我得 Corba 不完全?
- ★★★★★第十三期:CSDN论坛秀-Delphi版-本期作秀:hongqi162(失踪的月亮)
- 怎样向数据库中存入JPG图片啊,项目急用,在线等.
SetLength(S, Stream.Size);
Stream.WriteBuffer(Pointer(S)^, Length(S));
procedure TStrings.SetTextStr(const Value: string);
var
P, Start: PChar;
S: string;
begin
BeginUpdate;
try
Clear;
P := Pointer(Value);
if P <> nil then
while P^ <> #0 do
begin
Start := P;
while not (P^ in [#0, #10, #13]) do Inc(P);
SetString(S, Start, P - Start);
Add(S);
if P^ = #13 then Inc(P);
if P^ = #10 then Inc(P);
end;
finally
EndUpdate;
end;
end;
直接解密后是何数据还是贴点code
我感觉直接解密后保存到文件是正确,绝对可以直接解密存到TStringList
sList:TStringList;
MS, SS : TMemoryStream;
begin
sList:=TStringList.Create;
MS := TMemoryStream.Create;
SS := TMemoryStream.Create; TRY
MS.LoadFromFile('1.txt'); //读取加密的数据
MS.Position := 0;
SS:=Decrypt(MS); //解密
SS.SaveToFile('2.txt'); //这样是正确的 sList.text:= //如何才能将SS(Stream)中的数据放到StringList中
FINALLY
MS.Free;
SS.Free;
sList.Free;
end;代码如上,还望高手指点。
slist.loadfromstream(ss)