如题所述
Private Sub Command1_Click()
Open "e:\1.dat" For Append As #1
Print #1, "Test"
Close #1
FileCopy "e:\1.dat", "f:\2.dat"
End Sub
ããFileCopy("æºæ件å","ç®æ æ件å")
ãã两个åæ°é½æ¯å¿ éç,ä¸é½å å«è·¯å¾ã
ããå¨VBä¸filecopyå½æ°å¯ä»¥ç´æ¥è°ç¨ãèCopyFileå½æ°åä¸è½è¦å å®ä¹filesystemobjectåéï¼ç¶åæè½ç¨ãæè¿copyFileæ¯fileCopyçåè½ææä¸åã
ããFileCopyæ¯å个æ件çcopy,ç®æ æ件åå¯ä»¥åæºæ件åä¸åï¼ä¹å°±æ¯è¯´Copyæ件æ¶å¯ä»¥éæ°å½åã
ããCopyFileæ¯æä¸ä¸ªç®å½ä¸çæææ件copyå°å¦ä¸ä¸ªç®å½ä¸ï¼ä¸è¿ä¸copyç®å½ï¼è¦copyç®å½çè¯ï¼è¦ç¨copyFolder.
ããä¾å¦ï¼
ããfilecopy "D:\abc.txt","D:\aa\cc.txt"
ããæ件abc.txt 被Copyå°d:\aaä¸æ¶ï¼è¢«éå½å为cc.txt.
ããç¸å¯¹è·¯å¾å¨å¼å·åé¢å ä¸"app.path &"(å¼å·é¤å¤)
ããä¾å¦ï¼
ããfilecopy app.path & "abc.txt",app.path & "aa\cc.txt"
ããåä¸è·¯å¾çæ件æ件abc.txt 被Copyå°åä¸è·¯å¾aaä¸æ¶ï¼è¢«éå½å为cc.txt
Open "e:\1.dat" For Append As #1
Print #1, "Test"
Close #1
FileCopy "e:\1.dat", "f:\2.dat"
End Sub
ããFileCopy("æºæ件å","ç®æ æ件å")
ãã两个åæ°é½æ¯å¿ éç,ä¸é½å å«è·¯å¾ã
ããå¨VBä¸filecopyå½æ°å¯ä»¥ç´æ¥è°ç¨ãèCopyFileå½æ°åä¸è½è¦å å®ä¹filesystemobjectåéï¼ç¶åæè½ç¨ãæè¿copyFileæ¯fileCopyçåè½ææä¸åã
ããFileCopyæ¯å个æ件çcopy,ç®æ æ件åå¯ä»¥åæºæ件åä¸åï¼ä¹å°±æ¯è¯´Copyæ件æ¶å¯ä»¥éæ°å½åã
ããCopyFileæ¯æä¸ä¸ªç®å½ä¸çæææ件copyå°å¦ä¸ä¸ªç®å½ä¸ï¼ä¸è¿ä¸copyç®å½ï¼è¦copyç®å½çè¯ï¼è¦ç¨copyFolder.
ããä¾å¦ï¼
ããfilecopy "D:\abc.txt","D:\aa\cc.txt"
ããæ件abc.txt 被Copyå°d:\aaä¸æ¶ï¼è¢«éå½å为cc.txt.
ããç¸å¯¹è·¯å¾å¨å¼å·åé¢å ä¸"app.path &"(å¼å·é¤å¤)
ããä¾å¦ï¼
ããfilecopy app.path & "abc.txt",app.path & "aa\cc.txt"
ããåä¸è·¯å¾çæ件æ件abc.txt 被Copyå°åä¸è·¯å¾aaä¸æ¶ï¼è¢«éå½å为cc.txt
温馨提示:答案为网友推荐,仅供参考
第1个回答 2013-06-21
建议:你把VB中拷贝的函数多看看 没有的话 百度上有