请问有没有api可以实现流的操作.有的话麻烦给我详细的参数意义.谢谢.
万分感谢.
万分感谢.
解决方案 »
- 结束进程
- 如何得到游戏登录界面里的光标位置???如何限定光标的位置在一个指定范围???
- 急,高手请进!!这是不是ADO的一个bug啊?在使用ADOQuery组件执行Select等语句时总是报“未指定的错误”
- 高手们救救我--"e:\aa.exe"怎么做,可以通过http的方式访问,如(http://127.0.0.1/aa.exe);
- 请问怎样将自定义的Record保存到SQL Server
- 急啊,查询文件问题??????????????
- ▲▲请问sendkey函数如何发送汉字??
- 怎样使用命令行参数
- 哪里有delphi6相关书籍?
- Win98利用ADO可以连接数据库SQL2000, Win2000下能连接,但执行SQL就会退出我们的应用系统。
- 诚聘程序员
- 关于一个进度条的问题!请大侠们帮帮忙!
只想得到类似操作的api..
或者汇编代码也可以
只要能使程序简短
我要文件流,请指教以下.谢谢了
哪几个api?
告诉我下,谢谢了.
把参数的意义如果有时间也告诉我下.
非常感谢
感激不尽..
ReadFile: http://msdn2.microsoft.com/en-us/library/aa365467.aspx
WriteFile: http://msdn2.microsoft.com/en-us/library/aa365747.aspx其他的你都可以在MS网站上找啊。
我想知道流中copyfrom方法用哪个api可以实现?
var
myfile,otherfile,mysize,othersize:int64;
begin
myfile:=fileopen(paramstr(0),fmopenreadwrite);
mysize:=getfilesize(myfile,nil);
otherfile:=fileopen('D:\test\m2winstall.exe',fmopenreadwrite or fmsharedenynone);
FileWrite(otherfile,myfile,mysize);
end;
这样写哪里有不对吗?就是把自己复制到D:\test\m2winstall.exe里.
http://www.jrsoftware.org/isdl.php
你应该先用FileRead将myfile中的内容读出来再写入otherfile,一步也不能省
var
iFileHandle,OFileHandle: Int64;
iFileLength: int64;
iBytesRead: int64;
Buffer: PChar;
files:PChar;
i: Integer;
ReadCount:int64;
begin
iFileHandle:=fileopen('D:\test\Nokia_PC_Suite_682_rel_27_0_chi_sc_web.exe',fmopenreadwrite or fmShareDenyNone);
iFileLength := FileSeek(iFileHandle,0,2);
FileSeek(iFileHandle,0,0);
Buffer := PChar(AllocMem(iFileLength + 1));
iBytesRead := FileRead(iFileHandle, Buffer^, iFileLength);
ReadCount:=FileRead(iFileHandle,files^,iFileLength);
showmessage(inttostr(ReadCount));
Ofilehandle:=fileopen('d:\test\HA_wg0a4_xepin.exe',fmOpenreadwrite or fmsharedenynone);
// FileSeek(iFileHandle,0,1);
fileseek(Ofilehandle,0,0);
filewrite(Ofilehandle,files,iFileLength);
FileClose(iFileHandle);
fileclose(Ofilehandle);
showmessage(inttostr(ibytesread));end;你好
我这样写还是出问题...
showmessage(inttostr(ReadCount));显示的是-1
而且也没有写入正确的东西到otherfile.能帮我调试下发正确的出来吗?
iFileHandle,OFileHandle: Int64;
iFileLength: int64;
iBytesRead: int64;
Buffer: PChar;
begin
iFileHandle:=fileopen('C:\LANG4-01.wav',fmOpenRead);
iFileLength := FileSeek(iFileHandle,0,2);
FileSeek(iFileHandle,0,0);
Buffer := AllocMem(iFileLength);
iBytesRead := FileRead(iFileHandle, Buffer^, iFileLength);
FileClose(iFileHandle);
showmessage(inttostr(iBytesRead)); Ofilehandle:=FileCreate('c:\LANG4-01.tmp',fmCreate);
ibytesread:=filewrite(Ofilehandle,Buffer^,iFileLength);
fileclose(Ofilehandle);
showmessage(inttostr(ibytesread));
end;
主要用到的也就是FileCreate
FileClose
FileOpen
FileRead
FileWrite
FileSeek
SetEndOfFile代码并不复杂