高手帮忙~~~~~~~ (一定结贴)

cainiao000 2003-03-21 06:35:50
我用加密算法加密字符串,
把加了密的字符串插入数据库,
有时插入正常,有时出错:字符串***之前有未闭合的引号。

我用字符代替函数:
password:=StringReplace(password,'''','o',[rfReplaceAll]);
password:=StringReplace(password,'(','o',[rfReplaceAll]);
password:=StringReplace(password,')','o',[rfReplaceAll]);
password:=StringReplace(password,',','o',[rfReplaceAll]);
password:=StringReplace(password,';','o',[rfReplaceAll]);
有时还是不行。
...全文
18 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
cainiao000 2003-03-22
  • 打赏
  • 举报
回复
谢谢各位,解决了
yyy1020 2003-03-21
  • 打赏
  • 举报
回复
一个稳健的方法:加密后的字符串全部转换成16进制字符串。
如:ABCD转换成:41424344
稳如泰山。
http://www.csdn.net/cnshare/soft/12/12825.shtm

ly_liuyang 2003-03-21
  • 打赏
  • 举报
回复
加了密的字符串插入数据库?
经过Base64编码以后就一定没有问题
Indy就可以做到
newfang 2003-03-21
  • 打赏
  • 举报
回复
gz & up
Magusflp008 2003-03-21
  • 打赏
  • 举报
回复
function StringReplace(const S, OldPattern, NewPattern: string; Flags: TReplaceFlags): string;

Description

StringReplace replaces occurrences of the substring specified by OldPattern with the substring specified by NewPattern. StringReplace assumes that the source string, specified by S, may contain Multibyte characters.

If the Flags parameter does not include rfReplaceAll, StringReplace only replaces the first occurrence of OldPattern in S. Otherwise, all instances of OldPattern are replaced by NewPattern.

If the Flags parameter includes rfIgnoreCase, The comparison operation is case insensitive.
Storm2008 2003-03-21
  • 打赏
  • 举报
回复
gz
cainiao000 2003-03-21
  • 打赏
  • 举报
回复
up 有分

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧