home *** CD-ROM | disk | FTP | other *** search
- <HTML><BODY>
- <%
- ' Method: CopyFileEx(strOrginalDirectory, strNewDirectory, strCopyPattern)
- ' CopyFile(strSrcPathName, strTrgtPathName)
- '
- ' Sample Operation:
- ' Copy files in directory of DirOrg to DirNew.
- '
- ' This file is provided as part of ASP Power Widgets Samples
- '
- ' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT
- ' WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
- ' INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
- ' OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
- ' PURPOSE.
-
- ' Copyright 1997-1998. All rights reserved.
- ' Dalun Software Inc. ASP Power Widgets
- ' http://www.dalun.com
- ' http://members.tripod.com/ActiveServerPage/
-
- sDirOrg = "DirOrg"
- sDirNew = "DirNew"
- sDirOrg = Server.MapPath("/") & "\" & sDirOrg 'sDirOrg = D:\inetpub\wwwroot\dirorg
- sDirNew = Server.MapPath("/") & "\" & sDirNew
-
- response.write "Files in """ & sDirOrg & """ will be copied to """ & sDirNew & """.<br>"
-
- Set oFDMgt = Server.CreateObject("ASPPW.FDMgt")
- iReturnCode = oFDMgt.CopyFileEx (sDirOrg, sDirNew, "*.*")
-
- if iReturnCode = -1 then
- response.write "Operation failed.<br>"
- if oFDMgt.GetLastErrNum <> 0 then
- response.write oFDMgt.GetLastErrDescription & "<br>."
- end if
- elseif iReturnCode = 0 then
- response.write "Directory """ & sDirOrg & " not found.<br>"
- else
- response.write "Operation succeeds.<br>"
- end if
-
- 'Method: CopyFile(strSrcPathName, strTrgtPathName)
- '
- 'Sample Operation:
- 'Copy file sample.txt in directory of DirOrg to "c:\".
-
- sSrcPathName = "DirOrg\sample.txt"
- sTrgtPathName = "c:\me.txt"
- sSrcPathName = Server.MapPath("/") & "\" & sSrcPathName
-
- response.write "File """ & sSrcPathName & """ will be copied as """ & sTrgtPathName & """.<br>"
-
- iReturnCode = oFDMgt.CopyFile (sSrcPathName, sTrgtPathName)
-
- if iReturnCode = -1 then
- response.write "Operation failed."
- if oFDMgt.GetLastErrNum <> 0 then
- response.write oFDMgt.GetLastErrDescription
- end if
- elseif iReturnCode = 0 then
- response.write "File """ & sSrcPathName & " not found.<br>"
- else
- response.write "Operation succeeds."
- end if
-
- Set oFDMgt = nothing
- %>
- </BODY></HTML>
-
-
-
-
-
-