Showing posts with label Download. Show all posts
Showing posts with label Download. Show all posts

Thursday, 27 November 2014

C# code to download a file from a website URL

Hi All,
Yesterday one of my colleagues was having issue with downloading a file from URL using c# for one of the projects. This is a general requirement for many projects and thought it would be helpful if I post here.

using System;
using System.IO;
using System.Net;
using System.Text;

namespace FileDownloadSample
{
    class Program
    {
        static void Main(string[] args)
        {

            HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://www.yoursite.com/yourfile.pdf");

            request.Method = "GET";

            var encoding = new UTF8Encoding();

            request.Headers.Add(HttpRequestHeader.AcceptLanguage, "en-gb,en;q=0.5");
            request.Headers.Add(HttpRequestHeader.AcceptEncoding, "gzip, deflate");

            request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
            request.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0";

            var resp = (HttpWebResponse)request.GetResponse();

           

            using (var stream = File.Create("TargetFileName.pdf"))
                resp.GetResponseStream().CopyTo(stream);


        }
    }
}

Monday, 10 June 2013

SQL Server 2014 New Features

Although it doesn’t seem possible so soon, Microsoft announced SQL Server 2014 at this year’s TechEd 2013 conference in New Orleans. Quentin Clark, Microsoft Corporate Vice President for SQL Server, said that Microsoft is getting ready for the upcoming SQL Server 2014 release. Some of the most important new features in SQL Server 2014 include the following:

In-Memory OLTP Engine
The new In-Memory OLTP Engine (formerly code-named Hekaton) will provide OLTP performance improvements by moving selected tables into memory. The In-memory OTLP Engine works with commodity hardware and won’t require any application code changes. A built-in wizard will help you to choose which tables go in memory and select the stored procedures that will be compiled into machine code for high performance execution.
EdgeNet, an early adopter, saw a 7X performance increase with no code changes. Microsoft claims that some applications can achieve a 50x performance boost using the new In-Memory OTLP engine.

Backup Encryption
Encrypting backups gets simpler in SQL Server 2014.  Check out a great illustration of the how you can prevent anyone from taking your backup file and restoring it to another database server with the new SQL Server 2014 encryption capabilities by reading My Favorite New Feature in SQL Server 2014 by Joey D'Antoni.

Business Intelligence
SQL Server 2014 includes business intelligence (BI) improvements to help build and support vast databases and data warehouses. Learn more about what SQL Server 2014 will do for your business Intelligence efforts in Upcoming Business Intelligence Enhancements in SQL Server 2014 by Kevin Kline.

In-Memory OLTP Engine
In-Memory OLTP significantly improves the OLTP workload and reduces the time required for processing. The performance gains depend on the hardware infrastructure you have and how you are writing your queries. Get more details from Arshad Ali in SQL Server 2014 In-Memory OLTP Architecture and Data Storage.

Memory Optimization Advisor
The SQL Server 2014 Memory Optimization Advisor will help you quickly analyze your tables and walks you through reviewing and migrating disk-based table to In-Memory OLTP tables. Greg Larsen give you a walk-through of how to use the Memory Optimization Advisor tool to migrate a table in the AdventureWorks2012 database. See, SQL Server 2014 Memory Optimization Advisor.

Windows Azure Integration
SQL Server 2014 includes the ability to use Windows Azure for offsite backup storage and as a disaster recovery site. With SQL Server 2014 you can backup and restore your databases from copies stored in Windows Azure, which can quickly and easily provide off-site storage for all backups. More specifics are available in SQL Server 2014 CTP2 and Azure Backups by Joseph Karnes.

Friday, 28 January 2011

Skip or bypass Rapidshare, Megaupload Waiting time

Yes, you are reading it correctly, its not a prank or joke, now you can easily avoid the waiting time or usually we say time limit when you download as a free user from the file sharing services such as rapidshare, megaupload, deposifiles, hotfile. Normally you have to wait for 20-60 minutes to download the second file after downloading the first one. They implement ways to invite users to purchase a premium service. But this way of limiting Free download limit and asking free users to wait for long time to start another download can be annoying one.
Bypass Download Limit  in rapidshare, hotfile, megauploadSkipscreen is an extension to browser to by pass waiting time on download. Unfortunately it can only be used with Firefox browsers to avoid waiting time while downloading files from some popular File hosting services like:

* Rapidshare.com
* zShare.net
* MediaFire.com
* Megaupload.com
* Sharebee.com
* Depositfiles.com
* Sendspace.com
* Divshare.com
* Linkbucks.com
* Uploaded.to
* Hotfiles.com
* 4shared.com
* Limelinx.com
* Link-Protector.com
Its use is very simple and does not require any configuration, just go to the addon page of the extension and install it, restart your browser and enter one of thesedownload sites and you will no longer have to wait.
Download Skip Screen Firefox Extention

Alternative Methods or Hacks to Beat Rapidshare Download Limits and Waiting Time

Method 1:  Using Java Script:
1. Goto the page you want to download
2. Select FREE button
3. In the address bar put the following: javascript:alert(c=0)
4. Click OK
5. Click OK to the pop-up box
6. Enter the captcha
7. Download Your File

Method 2:  Request a new IP address from your ISP server
Here’s how to do it in windows:
1. Click Start
2. Click run
3. In the run box type cmd.exe and click OK
4. When the command prompt opens type the following.
ENTER after each new line.
ipconfig /flushdns
ipconfig /release
ipconfig /renew

exit
Note: This might only work for DSL/Modem Internet Connection, not for Cable Internet users

Disclaimer: Some call this as hacking trick or Hacking Rapidshare, but its in no way related to hacking. All information mentioned above is not created by Codejunction.blogspot.com.