Wednesday, April 10, 2013

Amazon S3 file download

A code snippet to download files from S3 by providing rootbucket, access key and secret key.


 AmazonS3 _client;  
 using (_client = Amazon.AWSClientFactory.CreateAmazonS3Client(accesskey, secretkey))  
 {  
      var util = new TransferUtility(_client);  
      var request = new TransferUtilityDownloadRequest()  
           .WithBucketName(rootbucket)  
           //e.g. full path is sohail/video/123.mp4  
           // root bucket is sohail, video/123.mp4 is WithKey  
     .WithKey(at which location have to download S3 file)   
           // Where to download location of hard disk.  
     .WithFilePath(ToDownloadPath);  
   util.Download(request);  
 }  

Files Downloader by extension from webpage


Download the files just providing the url and the desired extensions. Create a folder where the downloaded files will be placed. D:\FileDownloaderPath1\

Note: the .net framework must be available.

This will download those files that are linked via anchor tag.

It can be downloaded from the below URL.

FilesDownloader App

Tuesday, April 9, 2013

WMI and Custom configuration with multiple hierarchies


Please find the below link that will show how to use Multiple custom configuration hierarchy and WMI management.

WMI and Custom Configuration

Description
In the configuration file a custom configuration can be made to handle the services on a server. This configuration is using  a multiple hierarchy. So the following classes are being used to manage the multiple custom configuration.

ConfigurationSection
ConfigurationElement
ConfigurationElementCollection

Second thing, WMI will use that configuration and the relevant services on the specified server and will show in a grid. It can be stopped and started again via a desktop client.

Note: I have not used threading yet. This is just a demo so if a form hangs on then do wait.
Following classes are used to handle remote services.
ConnectionOptions
ManagementScope
ManagementObjectSearcher
ManagementObject