[Mono-list] Something nasty in the interpreter

Gonzalo Paniagua Javier gonzalo@gnome-db.org
Mon, 22 Apr 2002 12:49:26 +0200


--ZGiS0Q5IWpPtfppv
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline

	Do you have a recent runtime + library version?
	Do the attached example work?


--ZGiS0Q5IWpPtfppv
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: attachment; filename="dnstest.cs"

using System;
using System.Net;

public class MyClass
{
	public static void Main (string [] args)
	{
		IPHostEntry iphe;

		for (int i=0; i < args.Length; i++){
			iphe = Dns.GetHostByName (args [i]);
			Console.WriteLine (iphe.HostName);
			for (int k=0; k < iphe.Aliases.Length; k++)
				Console.WriteLine ("\t" + iphe.Aliases [k]);
			for (int k=0; k < iphe.AddressList.Length; k++)
				Console.WriteLine ("\t" + iphe.AddressList [k].ToString ());
		}

		for (int i=0; i < args.Length; i++){
			iphe = Dns.Resolve (args [i]);
			Console.WriteLine (iphe.HostName);
			for (int k=0; k < iphe.Aliases.Length; k++)
				Console.WriteLine ("\t" + iphe.Aliases [k]);
			for (int k=0; k < iphe.AddressList.Length; k++)
				Console.WriteLine ("\t" + iphe.AddressList [k].ToString ());
		}
	}
}

--ZGiS0Q5IWpPtfppv--