Etichetă: c# example

All RapidShare Links Blogspot C#

This article has been written before more than 24months, information might old.

Imi trebuia ceva care sa poata culege toate linkurile de tip ” rapidshare ” de pe un blog hostat de Blogspot , ideea ar fi fost ca imediat ce am toate linkurile le pot verifica daca mai sunt inca valide , si m am gandit sa scriu repede un mini-tool pentru aceasta .

Sursa (c#) :

using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.IO;
using System.Net;
using System.Windows.Forms;

namespace BRLS
{
    public partial class fmain : Form
    {
        public fmain()
        {
            InitializeComponent();
        }

        public void az_GetContent(string strURL)
        {

            StringBuilder sb = new StringBuilder();
            byte[] buf = new byte[8192];
            HttpWebRequest request = (HttpWebRequest)
            WebRequest.Create(strURL + "/search?&max-results=999999999");
            HttpWebResponse response = (HttpWebResponse)
                request.GetResponse();
            Stream resStream = response.GetResponseStream();
            string tempString = null;
            int count = 0;
            do
            {
                count = resStream.Read(buf, 0, buf.Length);
                if (count != 0)
                {
                    tempString = Encoding.ASCII.GetString(buf, 0, count);
                    sb.Append(tempString);
                }
            }
            while (count 0);

            string strFilePath,temp,tempname;
            temp = Path.GetTempPath().ToString();
            tempname = "aztake.txt";
            strFilePath = String.Concat(temp,