请指教一下delphy 里面的fileopen的具体用法。
解决方案 »
- delphi是否有真的官方中文版。
- 在DELPHI7Z中用IDHTTP发送POST命令,Protocol Version是pv1_1但通过端口工具确发现是1.0版的,怎么解决?
- 在DBGRID中如何使行处于选中状态
- DELPHI爱好者的群1509183~~
- 各位高手,请帮帮忙!急!!急!!
- 哪有ERP示范软件可下载参观?
- 高分求助:由于本人以前极少在SQL中使用参数,如今发生错误,急啊(SQLServer 2000+ADO)
- 关于DBgrid使用的两个问题(有点难度),在线等待给分。。。
- 最简单的控件问题?
- 如何检测网卡上网线是否连接上了,就像win2000一样,插上网线就能提示连接速度?
- spcomm控件传输慢
- 怎么把一个控件的Owner用String的形式显示出来???
{$IFDEF MSWINDOWS}
const
AccessMode: array[0..2] of LongWord = (
GENERIC_READ,
GENERIC_WRITE,
GENERIC_READ or GENERIC_WRITE);
ShareMode: array[0..4] of LongWord = (
0,
0,
FILE_SHARE_READ,
FILE_SHARE_WRITE,
FILE_SHARE_READ or FILE_SHARE_WRITE);
begin
Result := -1;
if ((Mode and 3) <= fmOpenReadWrite) and
((Mode and $F0) <= fmShareDenyNone) then
Result := Integer(CreateFile(PChar(FileName), AccessMode[Mode and 3],
ShareMode[(Mode and $F0) shr 4], nil, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, 0));
end;// 最后还是调用API函数CreateTile的
fileopen 文件名,类型
do while not eof(值)
每行的值。
loop
function FileRead(Handle: Integer; var Buffer; Count: Integer): Integer;
Handle就是这个句柄了。。一行一行的读。。不清楚DELPHI的函数
像 .net 中
fileopen 文件名,类型
do while not eof(值)
每行的值。
loop
var
strLst: TStringList;
fl: TextFile;
s: string;
begin
strLst := TStringList.Create;
AssignFile(fl, 'test.txt');
Reset(fl);
while not EOF(fl) do
begin
ReadLn(fl, s);
strLst.Add(s);
end;
CloseFile(fl);
ShowMessage(strLst.GetText);
end;
strLst: TStringList;
fl: TextFile;
s: string;
begin
opendialog1.Execute;
AssignFile(fl, opendialog1.FileName);
Reset(fl);
while not EOF(fl) do
begin
writeln(fl,'china');
end;
CloseFile(fl);
end;
这样为什么会出错呢?
{
...
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// DON'T display a new MDI child window during startup!!!
cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
...
};