using System;
using System.Net;
using System.Text;
using System.IO;
class GetDownloadData {
static StreamWriter swHtml;
static string strSb;
static byte[] response;
static string strLang;
static void Main(){
WebClient client = new WebClient();
int iPage=0;
const string strAdresse = "http://www.google.de/search";
Console.WriteLine("Language:(de/en) ");
strLang = Console.ReadLine();
Console.WriteLine("Suchbegriff: ");
strSb = Console.ReadLine();
response = client.DownloadData(strAdresse+"?hl="+strLang+"&q="+strSb+"&btnG=Google-Suche&meta=");
string strDirName = strSb.Trim('|','#','\\','<','>','/','{','}','&');
swHtml = new StreamWriter(strDirName+"\\suche"+strSb+iPage+".html");
swHtml.Write(Encoding.ASCII.GetString(response));
swHtml.Close();
for(int i=0;i<=110;i=i+10){
response = client.DownloadData(strAdresse+"?q="+strSb+"&hl="+strLang+"&lr=&start="+i+"&sa=N");
swHtml = new StreamWriter(strDirName+"\\suche"+strSb+i+".html");
swHtml.Write(Encoding.ASCII.GetString(response));
swHtml.Close();
Console.WriteLine(i+"\n");
iPage++;
}
}
}