S
suntofly
Unregistered / Unconfirmed
GUEST, unregistred user!
[?]creatfile都没有问题了,但是writefile的时候就说拒绝访问 那位大侠能帮我找一个<br>writefile 的例子研究一下 谢谢!!<br> hdevice:=CreateFile('//./Passthru',GENERIC_READ and GENERIC_WRITE,<br> 0,//share mode<br> nil,//no security<br> OPEN_EXISTING,<br> FILE_ATTRIBUTE_NORMAL,<br> 0);//no template<br><br> str:='&'+edit1.Text;<br> num:=length(str);<br> //ifwrite:=WriteFileex(hDevice,pchar(str),num+2,ln,nil);<br> ifwrite:=WriteFile(hDevice,pchar(str),num+2,pwnum,ln);<br> num:=getlasterror();<br> ShowMessage(SysErrorMessage(GetLastError));<br> showmessage(inttostr(num));<br> showmessage(str);<br> if num=0 then<br> begin<br> showmessage('writefile succeded!!');<br> end<br> else<br> showmessage('writefile failed!!');