// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Net; using ByteFX.Data.MySqlClient; class TestClass { public static void test(string url) { WebRequest wr = WebRequest.Create(url); string html = new System.IO.StreamReader(wr.GetResponse().GetResponseStream()).ReadToEnd(); MySqlConnection con = new MySqlConnection("Database=Test;Data Source=localhost;User Id=;Password="); con.Open(); MySqlCommand ins = new MySqlCommand("INSERT INTO arkiv VALUES(@url,@html)", con); ins.Parameters.Add(new MySqlParameter("@url", url)); ins.Parameters.Add(new MySqlParameter("@html", html)); ins.ExecuteNonQuery(); con.Close(); } public static void Main(string[] args) { test("http://localhost/echo.aspx?f1=123&f2=abc"); } }