CreateFile

<!-- /* Font Definitions */ @font-face {font-family:"MS 明朝"; panose-1:2 2 6 9 4 2 5 8 3 4; mso-font-alt:"MS Mincho"; mso-font-charset:128; mso-generic-font-family:roman; mso-font-pitch:fixed; mso-font-signature:-1610612033 1757936891 16 0 131231 0;} @font-face {font-family:SimSun; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-alt:宋体; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 135135232 16 0 262145 0;} @font-face {font-family:Century; panose-1:2 4 6 3 5 7 5 2 3 3; mso-font-alt:"Times New Roman"; mso-font-charset:0; mso-generic-font-family:roman; mso-font-format:other; mso-font-pitch:variable; mso-font-signature:3 0 0 0 1 0;} @font-face {font-family:"/@MS 明朝"; panose-1:2 2 6 9 4 2 5 8 3 4; mso-font-charset:128; mso-generic-font-family:roman; mso-font-pitch:fixed; mso-font-signature:-1610612033 1757936891 16 0 131231 0;} @font-face {font-family:"/@SimSun"; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 135135232 16 0 262145 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0mm; margin-bottom:.0001pt; text-align:justify; text-justify:inter-ideograph; mso-pagination:none; font-size:10.5pt; mso-bidi-font-size:12.0pt; font-family:Century; mso-fareast-font-family:"MS 明朝"; mso-bidi-font-family:"Times New Roman"; mso-font-kerning:1.0pt;} /* Page Definitions */ @page {mso-page-border-surround-header:no; mso-page-border-surround-footer:no;} @page Section1 {size:595.3pt 841.9pt; margin:99.25pt 30.0mm 30.0mm 30.0mm; mso-header-margin:42.55pt; mso-footer-margin:49.6pt; mso-paper-source:0; layout-grid:18.0pt;} div.Section1 {page:Section1;} -->

1 取当前 时间 ,使用 GetLocalTime 函数,然后按照你的需要 理成 对应 的字符串
2
、使用 CreateDirectory 建文件 入完整的文件 路径,比如你当前文件 夹为 C:/A ,你要 建文件 B 则传 C:/A/B/
3
建文件有多 方法,比如 fopen CreateFile 等。

 

使用 GetFileOpenName
li_rtn = GetFileOpenName("Select File", &
  docpath, docname, "PDF", &
  + "PDF Files (*.PDF),*.PDF," &
  + "Doc Files (*.DOC),*.DOC," &
  + "All Files (*.*), *.*", &
  "d:/", 18)
IF li_rtn < 1 THEN return
ls_filename = string(docpath)

 

The following example displays a Select File dialog box that allows multiple selection. The file types are TXT, DOC, and all files, and the initial directory is C:/Program Files/Sybase. The option flag 18 specifies that the Explorer-style dialog box is used (2^1 = 2), and the Read Only check box is hidden (2^4 = 16). The selected filenames are displayed in a MultiLineEdit control.

string docpath, docname[]

 integer i, li_cnt, li_rtn, li_filenum

 

 li_rtn = GetFileOpenName("Select File", &

  docpath, docname[], "DOC", &

  + "Text Files (*.TXT),*.TXT," &

  + "Doc Files (*.DOC),*.DOC," &

  + "All Files (*.*), *.*", &

  "C:/Program Files/Sybase", 18)

 

 IF li_rtn < 1 THEN return

 li_cnt = Upperbound(docname)

 

 for i=1 to li_cnt

  mle_selected.text +=

  string(docpath)+"/"+(string(docname[i]))+"~r~n"

 next

In the following example, the dialog box has the title Open and displays text files, batch files, and INI files in the Files of Type drop-down list. The initial directory is d:/temp. The option flag 512 specifies that the old-style dialog box is used and the Network button is hidden (2^9 = 512). 

// instance variables

 // string is_filename, is_fullname

 int li_fileid

 

 if GetFileOpenName ("Open", is_fullname, is_filename, &

  "txt", "Text Files (*.txt),*.txt,INI Files " &

  + "(*.ini), *.ini,Batch Files (*.bat),*.bat", &

  "d:/temp", 512) < 1 then return

 

 li_fileid = FileOpen (is_fullname, StreamMode!)

 FileRead (li_fileid, mle_notepad.text)

 FileClose (li_fileid)

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值