I need to be able to detect when files and folders are copied to a 1 of 100 subfolders in a file share, then copy those files/folders onto another site. I currently use powershell for this but it's not a good solution, was hoping someone could give me pointers on alternative for monitoring windows file share
Cheers
I recently created a .NET application to copy any new file over FTP.
I used FileSystemWatcher Class to fire an event whenever there is a new incoming file. You can enable the watcher to look into sub directories. Then copy those file to your desired location with the help of File Class.
ref: msdn
Related
I had a task that required me to move files from a subdomain to the public_html directory on my cPanel. To move them I simply selected the files and directories I wanted from the subdomain, clicked move and entered the destination path.
Once the move process had completed, only some of the files and folders were in the new location (public_html). The files that didn't move to the new location no longer seem to exist.
Has anyone encountered this problem before and is there any way to recover the lost files (they aren't in the trash)?
Thanks in advance!
Have you tried to connect to your server with other FTP client like FileZilla or something similar to see if the files are still missing. It seems like UI glitch. cPanel represents only an user interface and is not able to delete the files.
I have written some windows services. Each service has some settings that I currently store in a .ini file.
I would like to manage the services now in a control panel and would like to be able to manage the settings there in a collective manner.
Are the respective app.config files the right choice?
or should i store the settings (like timer Intervall, etc.) in the registry?
If not
How to Access the app.config files?
I have tried something like that
Dim fileMap As ConfigurationFileMap =
New ConfigurationFileMap("myService.exe.config")
Dim configuration =
ConfigurationManager.OpenMappedMachineConfiguration(fileMap)
But the AppSettings are Nothing
or am I on the wrong track?
I hope somebody has a great idea
how to manage and configure windows services with an own control panel?
First of all: With the ServiceController Class you can control every Serivce (Start, Stop, Restart, and so on). You should check out the example at the MSDN page if you want to know how it works.
How you save your settings is your own choice. You could use the .config file, a .ini file or just the registry. Just choose the option which works better for you.
Since your services already use a .ini as a config file you could just access and edit these files with your control panel. I guess the .ini files are saved in the same folder where the service.exe is located. So you can use AppDomain.CurrentDomain.BaseDirectory to find out where the service is located on the machine and start editing it. For your control panel you can also use a .ini config file our just play around with My.Settings
Hope this brings you on the right track!
I wanted to copy a file from one folder to another folder within a ftp server. For example if a file is on folder1 in a ftp server then i want copy it to folder2. I know how to move or rename the files in ftp server. I also searched in google to copy file within ftp server but i didn't get a work around for it.Also does rdp command line provides facilities like this? So anyone know how it can be done?
Now i am uploading the same file to two folders separately.So it does take more time.So if it is possible to copy the file then i need to upload only once and then copy it to other folder easily.
So anyone please come up with ideas or codes to do it.
Thank you
Regrettably, the answer is simple: there is no FTP copy command. For an exhaustive, well referenced list of FTP commands, see http://en.wikipedia.org/wiki/List_of_FTP_commands.
In the old days, when FTP was standard, you would have used its companion program telnet to operate in the remote directory.
I have successfully been able to upload single files to an FTP with this:
My.Computer.Network.UploadFile
Is there a way to upload an entire directory, such as this:
My.Computer.Network.UploadFolder
Never worked with FTP in VB.NET, but it seems there is no direct way to do it.
Here is what people say about how it can be done:
Traversal the local directory
Create the same directory structure in the FTP server.
Upload the file in each local directory.
Also see here for same question answered (C#). It confirms there is no built-in way. You would have to write some code or use 3rd party libraries.
I am trying to upload two files to a webserver so my teacher can see it. I am using winsp since my filezila doesnt work. But for some reason it is telling me that i don't have access to that page. Can anyone tell me why is it doing that.Here is a picture of my screen.
I am just not understanding why it is telling me that i don't have to access it.
If I had to take a guess, that public_html folder is your public directory where you should put things that anybody can get to (like through a browser). You have your files outside of that directory, so your page can't access them.
edit:
It's an educated guess, as I have seen a fair amount of server configurations that name the public web folder as such (other common names are "www" and "httpdocs")
Problem definitly isn't in code. There is error while uploading files. Can you connect to FTP regulary? If you can. Look for Active or Passive file transfer to FTP. Also if you can upload files, files must be in public_html folder to be visible from browser.
Active or passive
First read Neal comment.
second, you should probably copy the files into the /public_html folder, instead of the / (root) folder.