kwilliams Posted October 30, 2006 Share Posted October 30, 2006 I used FSO in ASP without any problems, and I'm wondering if you can use FSO in the same way in ASP.NET (2.0). This is the method that I've been using in ASP: Dim strPhotoPath = Trim(rsPhoto("DC_FileName").Value.ToString)Dim objFSO As Object = Server.CreateObject("Scripting.FileSystemObject")Dim strPhotoFilePath As String = "\\SERVER1\Photo\" & strPhotoPathDim strPhotoDestination As String = "e:\wwwroot\SERVER2\temp\"If objFSO.FileExists(strPhotoFilePath) Then 'Copy file to its destination Dim objFileCopy As Object = objFSO.GetFile(strPhotoFilePath) objFileCopy.Copy(strPhotoDestination) objFileCopy = nothingEnd If Thanks for any help. Link to comment Share on other sites More sharing options...
aspnetguy Posted October 30, 2006 Share Posted October 30, 2006 it is different in .Net you use hte System.IO namespace. To copy a file it is as simple asFile.Copy("sourcePath","destPath")read this for more detailshttp://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=207 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now