I’m new in ASP.NET but I used ASP before.
I am looking for ways to copy files and/or directories from my local machine to another remote machine (say, into a shared folder assuming I know the machine IP address).
When copying all files from a directory and sub-directories, I should be able to pick only some of them (for instance, all files finishing in ".doc" and not exceeding 1 MB)
How can I do that in ASP.NET, normal ASP or VB Script?
It may be VB.NET since it seems to me that ASP.NET works with VB.NET whereas ASP didn’t use such things...
The only way I know to work with files was Scripting.FileSystemObject when I was programming in ASP or VB Script but I was wondering if there were new better ways since.
you need to look into the classes provided within the system.io namespace. You will be able to do most of what you mentioned here with those classes. One thing to note, though, you will have to configure the security settings to allow your machine to write to the share.
Sure don't know what i'm going for, but i'm gonna go for it for sure.
Thanks! I'm having a look at system.io classes and it seems this is what I was looking for.
However, how should I configure the security settings to be able to write to the share?
if you put the copy process behind a web page, then it runs under the ASPNET account (or whatever account you configured for asp.net to use). this mean that when you (on your account) can access the share, there is no guarantee that ASPNET (the webpage account) can access the same share.
Need a site code sample in a different language? Try converting it with: http://converter.telerik.com/
What's the best way to perform the copy of my files/directories automatically (say, every night at a certain time)?
When I was programming in ASP, I would have written a VB Ssript (.vbs) and make it run every night using the Task Scheduler that comes with Windows.
Are there better ways to do such things in .NET (with ASP.NET, VB.NET, ....)?