RT
解决方案 »
- 关于软件显示的问题
- 一个uppercase 函数的问题!!
- 谁那里有水晶报表7.0安装包或者设计器也行,急用!水晶报表8.0向下兼容吗,谢谢!本人QQ 147040054
- 我用delphi6+Access2000做了一个简单系统,其中有一个表里得内容要发布到网上,请问如何编程实现?
- 谁能帮我解决这个问题,我马上给分
- 請教如何用delphi獲取真實的下載地址,類似flashget的下載功能。
- 怎么入门
- 如何实现自动合并?
- 在主程序中加入类是不是要手动加入
- 怎样将日期转换成20010123,而不是2001123
- 关于report报表打印在线等
- 简单问题:在DBGrid中,按ctrl+Delete不让删除,怎么实现?
procedure restr(fn: Ansistring; stxt, toTxt: string);
var
StrL, x, pos, fpos, num, readnum: integer;
buf: array[0..500] of char;
SFile: file;
L, H: char;
begin
StrL := Length(stxt);
AssignFile(sfile, fn);
reset(sfile, 1);
repeat
buf := #0;
Num := 0;
fpos := filepos(sfile);
blockread(sfile, buf, Sizeof(Buf), readnum);
repeat
Pos := num;
for x := 1 to StrL do begin
L := sTxt[x]; H := Buf[num];
if L = H then begin
inc(num);
if x = StrL then begin
seek(sfile, fpos + pos);
blockWrite(sfile, toTxt[1], Length(totxt));
end;
end
else begin
if x = 1 then inc(num);
break;
end;
end;
until num >= high(buf);
until readnum <= 0;
closefile(sfile);
end;procedure TForm1.Button1Click(Sender: TObject);
begin
Findstr('文件名', '003e2b6c3d', '53e2e6c3fs');
end;
FILE fp1;
unsigned char *ch=new char[FILELENGTH];
int i,len;
fp1=fopen("filename","rb+");
len=fread(ch,1,FILELENGTH,fp1);
for (i=0;i<len-4;i++) {
if (!memcmp(ch,"\x0\x3e\x2b\x6c\x3d",5)) break;
}
if (i<len-4) memcpy(ch+i,"\x5\x3e\x2e\x6c\x3f",5);
fseek(fp1,0,SEEK_SET);
fwrite(ch,1,len,fp1);
fclose(fp1);