How to Retrieve HTTP content in .NET


Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in D:\InetPub\vhosts\kwu-1639.package\kennywu.info\wwwroot\wp-content\plugins\wp-syntax\wp-syntax.php on line 380

HttpWebRequest and HttpWebResponse greatly simplified http content retrial process. Code snippet below demonstrated how easy to use.

using System;
using System.Text;
using System.Net;
using System.IO;
 
static void Main(string[] args)
{
    string webUrl = "http://www.google.com";
    WebRequest req = WebRequest.Create(webUrl);
    req.Timeout = 10000;
    WebResponse resp = req.GetResponse();
    StreamReader reader = new StreamReader(resp.GetResponseStream(), Encoding.ASCII);
    Console.WriteLine(reader.ReadToEnd());
    resp.Close(); // Close the response to free resources.
    reader.Close();
}

Simple and elegant. To look for more…Retrieving HTTP content in .NET

ReadyNAS Setup

FrotView setup
/etc/default/services
MLDonkey
Download the latest version:
http://www.readynas.com/contributed/super-poussin/MLDONKEY_3.01.bin
After installation by frontview, the web access ini file needs to add the client ip address
/c/media/Mldonkey/.mldonkey/downloads.ini
The service start script is:
/etc/frontview/addons/bin/MLDONKEY/start.sh
The launch command is:cd /media/Mldonkey/.mldonkey/
/usr/local/mldonkey/mlnet -pid /media/Mldonkey/.mldonkey/ -find_port&

Go to Mldonkey web interface, Help tab and then click on Sysinfo. Open all ports at your router.
BitTorrent 6882 client_port TCP
BitTorrent 6881 tracker_port TCP
Core 4080 http_port
Core 4000 telnet_port
Core 4001 gui_port
Donkey 19248 client_port TCP
Donkey 19252 client_port UDP
Donkey 12647 overnet_port TCP+UDP

If it crashes a lot, need to restrict the number of active connection from default 100 to 50.
max_opened_connections 50