1.先说声抱歉,搞错了,原来是CnDES单元才对.
我是这样使用的,先引用CnDES单元,然后:
EDIT2.TEXT:=DESEncryptStr('KEY',EDIT1.TEXT);{加密显示返回加密后的字串}
EDIT3.TEXT:=DESDecryptStr('KEY',EDIT2.TEXT);{解密并显示原来的字串}
2.另CnXlsWriter单元,有一方法使用了Vartype函数,在D2009下是没有办法得出结果的,代码始下:
procedure TCnXlsWriter.SetCells(const ACol: Byte; const ARow: Word; const Value: Variant);
var
aStr: string;
aInt: Int64;
aFloat: Extended;
aCode: Integer;
begin
case VarType(Value) of
varSmallint, varInteger, varByte:
XlsWriteCellRk(FStream, ACol, ARow, Value);
varSingle, varDouble, varCurrency:
XlsWriteCellNumber(FStream, ACol, ARow, Value);
varString, varOleStr:
begin
aStr := Value;
Val(aStr, aInt, aCode);
if aCode = 0 then
begin
XlsWriteCellRk(FStream, ACol, ARow, Value);
Exit;
end;
Val(aStr, aFloat, aCode);
if aCode = 0 then
begin
XlsWriteCellNumber(FStream, ACol, ARow, Value);
Exit;
end;
XlsWriteCellLabel(FStream, ACol, ARow, Value);
end;
varDate:
XlsWriteCellLabel(FStream, ACol, ARow, DateTimeToStr(Value));
else
XlsWriteCellBlank(FStream, ACol, ARow);
end;
end;
当调用你们所提供的示例(..\Examples\XlsWriter),所生成的EXCEL文件是没有内容的,请修正.
|