ASP OpenTextFile ·½·¨
¶¨ÒåºÍÓ÷¨
OpenTextFile ·½·¨´ò¿ªÖ¸¶¨µÄÎļþ£¬²¢·µ»Ø¿ÉÓÃÀ´·ÃÎÊ´ËÎļþµÄ TextStream ¶ÔÏó¡£
Óï·¨£º
FileSystemObject.OpenTextFile(fname,mode,create,format)
²ÎÊý | ÃèÊö |
---|---|
fname | ±ØÐèµÄ¡£Òª´ò¿ªµÄÎļþµÄÃû³Æ¡£ |
mode | ¿ÉÑ¡µÄ¡£ÈçºÎ´ò¿ªÎļþ¡£
|
create | ¿ÉÑ¡µÄ¡£ÉèÖÃÈç¹ûÎļþÃû²»´æÔÚ£¬ÊÇ·ñ´´½¨ÐÂÎļþ¡£True ָʾ¿É´´½¨ÐÂÎļþ£¬¶ø False ָʾÐÂÎļþ²»»á±»´´½¨¡£False ÊÇĬÈϵġ£ |
format | ¿ÉÑ¡µÄ¡£ÎļþµÄ¸ñʽ¡£
|
ʵÀý
<%
dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.OpenTextFile(Server.MapPath("testread.txt"),8,true)
f.WriteLine("This text will be added to the end of file")
f.Close
set f=Nothing
set fs=Nothing
%>