lsh127k 发表于 2010-10-21 20:35:20

怎么新建一个文件

我要写个程序,需要保存日志,先创建一个文本文件,再往里面写日志。请问怎么在硬盘上新建一个文件

catcher 发表于 2010-10-21 21:06:08

http://www.autoitx.com/forum.php?mod=viewthread&tid=12739&highlight=%D0%C2%BD%A8

xianhou 发表于 2010-10-21 21:11:34

#Include <File.au3>
_FileCreate($sFilePath)

zhongzijie 发表于 2010-10-21 21:54:16

谢谢catcher 分享

bsdos 发表于 2010-10-21 22:55:19

fileopen要注意,写log时,mode要设置为1,使log追加在文件后面
Can be a combination of the following:
0 = Read mode
1 = Write mode (append to end of file)
2 = Write mode (erase previous contents)
4 = Read raw mode
8 = Create directory structure if it doesn't exist (See Remarks).
16 = Force binary(byte) reading and writing mode with FileRead and FileWrite
32 = Use Unicode UTF16 Little Endian reading and writing mode. Reading does not override existing BOM
64 = Use Unicode UTF16 Big Endian reading and writing mode. Reading does not override existing BOM
128 = Use Unicode UTF8 reading and writing mode. Reading does not override existing BOM

lsh127k 发表于 2010-10-22 09:23:46

学习了,谢谢大家的帮助

aft52577 发表于 2010-10-22 10:04:21

路过看一下,有人答了,不再作答

haodd 发表于 2010-11-15 14:15:13

路过看一下,有人答了,不再作答
aft52577 发表于 2010-10-22 10:04 http://www.autoitx.com/images/common/back.gif


    fileopen最佳
页: [1]
查看完整版本: 怎么新建一个文件