DnsTest.cs 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594
  1. // DnsTest.cs - NUnit Test Cases for the System.Net.Dns class
  2. //
  3. // Authors:
  4. // Mads Pultz ([email protected])
  5. // Martin Willemoes Hansen ([email protected])
  6. //
  7. // (C) 2001 Mads Pultz
  8. // (C) 2003 Martin Willemoes Hansen
  9. //
  10. using System;
  11. using System.Linq;
  12. using System.Net;
  13. using System.Net.Sockets;
  14. using System.Threading;
  15. using NUnit.Framework;
  16. namespace MonoTests.System.Net
  17. {
  18. [TestFixture]
  19. public class DnsTest
  20. {
  21. private String site1Name = "google-public-dns-a.google.com",
  22. site1Dot = "8.8.8.8",
  23. site2Name = "google-public-dns-b.google.com",
  24. site2Dot = "8.8.4.4",
  25. noneExistingSite = "unlikely.xamarin.com";
  26. private uint site1IP = 134744072, site2IP = 134743044; // Big-Endian
  27. [Test]
  28. #if FEATURE_NO_BSD_SOCKETS
  29. [ExpectedException (typeof (PlatformNotSupportedException))]
  30. #endif
  31. public void AsyncGetHostByName ()
  32. {
  33. IAsyncResult async = Dns.BeginGetHostByName (site1Name, null, null);
  34. IPHostEntry entry = Dns.EndGetHostByName (async);
  35. SubTestValidIPHostEntry (entry);
  36. Assert.IsTrue (entry.HostName == "google-public-dns-a.google.com");
  37. }
  38. [Test]
  39. #if FEATURE_NO_BSD_SOCKETS
  40. [ExpectedException (typeof (PlatformNotSupportedException))]
  41. #endif
  42. public void AsyncGetHostByNameCallback ()
  43. {
  44. var evt = new ManualResetEvent (false);
  45. Exception ex = null;
  46. Dns.BeginGetHostByName (site1Name, new AsyncCallback ((IAsyncResult ar) =>
  47. {
  48. try {
  49. IPHostEntry h;
  50. h = Dns.EndGetHostByName (ar);
  51. SubTestValidIPHostEntry (h);
  52. } catch (Exception e) {
  53. ex = e;
  54. } finally {
  55. evt.Set ();
  56. }
  57. }), null);
  58. Assert.IsTrue (evt.WaitOne (TimeSpan.FromSeconds (60)), "Wait");
  59. Assert.IsNull (ex, "Exception");
  60. }
  61. [Test]
  62. #if FEATURE_NO_BSD_SOCKETS
  63. [ExpectedException (typeof (PlatformNotSupportedException))]
  64. #endif
  65. public void AsyncResolve ()
  66. {
  67. IAsyncResult async = Dns.BeginResolve (site1Dot, null, null);
  68. IPHostEntry entry = Dns.EndResolve (async);
  69. SubTestValidIPHostEntry (entry);
  70. var ip = GetIPv4Address (entry);
  71. Assert.AreEqual (site1Dot, ip.ToString ());
  72. }
  73. [Test]
  74. #if FEATURE_NO_BSD_SOCKETS
  75. [ExpectedException (typeof (PlatformNotSupportedException))]
  76. #endif
  77. public void AsyncResolveCallback ()
  78. {
  79. var evt = new ManualResetEvent (false);
  80. Exception ex = null;
  81. Dns.BeginResolve (site1Name, new AsyncCallback ((IAsyncResult ar) =>
  82. {
  83. try {
  84. IPHostEntry h = Dns.EndResolve (ar);
  85. SubTestValidIPHostEntry (h);
  86. } catch (Exception e) {
  87. ex = e;
  88. } finally {
  89. evt.Set ();
  90. }
  91. }), null);
  92. Assert.IsTrue (evt.WaitOne (TimeSpan.FromSeconds (60)), "Wait");
  93. Assert.IsNull (ex, "Exception");
  94. }
  95. [Test]
  96. public void BeginGetHostAddresses_HostNameOrAddress_Null ()
  97. {
  98. try {
  99. Dns.BeginGetHostAddresses (
  100. (string) null,
  101. new AsyncCallback (ShouldntBeCalled),
  102. null);
  103. Assert.Fail ("#1");
  104. } catch (ArgumentNullException ex) {
  105. Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2");
  106. Assert.IsNull (ex.InnerException, "#3");
  107. Assert.IsNotNull (ex.Message, "#4");
  108. Assert.AreEqual ("hostName", ex.ParamName, "#5");
  109. }
  110. }
  111. [Test]
  112. public void BeginGetHostAddresses_HostNameOrAddress_UnspecifiedAddress ()
  113. {
  114. // IPv4
  115. try {
  116. Dns.BeginGetHostAddresses (
  117. "0.0.0.0",
  118. new AsyncCallback (ShouldntBeCalled),
  119. null);
  120. Assert.Fail ("#A1");
  121. } catch (ArgumentException ex) {
  122. // IPv4 address 0.0.0.0 and IPv6 address ::0 are
  123. // unspecified addresses that cannot be used as
  124. // a target address
  125. Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#A2");
  126. Assert.IsNull (ex.InnerException, "#A3");
  127. Assert.IsNotNull (ex.Message, "#A4");
  128. Assert.AreEqual ("hostNameOrAddress", ex.ParamName, "#A5");
  129. }
  130. // IPv6
  131. try {
  132. Dns.BeginGetHostAddresses (
  133. "::0",
  134. new AsyncCallback (ShouldntBeCalled),
  135. null);
  136. Assert.Fail ("#B1");
  137. } catch (ArgumentException ex) {
  138. // IPv4 address 0.0.0.0 and IPv6 address ::0 are
  139. // unspecified addresses that cannot be used as
  140. // a target address
  141. Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#B2");
  142. Assert.IsNull (ex.InnerException, "#B3");
  143. Assert.IsNotNull (ex.Message, "#B4");
  144. Assert.AreEqual ("hostNameOrAddress", ex.ParamName, "#B5");
  145. }
  146. }
  147. void ShouldntBeCalled (IAsyncResult ar)
  148. {
  149. Assert.Fail ("Should not be called");
  150. }
  151. [Test]
  152. public void GetHostAddresses_HostNameOrAddress_Null ()
  153. {
  154. try {
  155. Dns.GetHostAddresses ((string) null);
  156. Assert.Fail ("#1");
  157. } catch (ArgumentNullException ex) {
  158. Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2");
  159. Assert.IsNull (ex.InnerException, "#3");
  160. Assert.IsNotNull (ex.Message, "#4");
  161. Assert.AreEqual ("hostNameOrAddress", ex.ParamName, "#5");
  162. }
  163. }
  164. [Test]
  165. public void GetHostAddresses_HostNameOrAddress_UnspecifiedAddress ()
  166. {
  167. // IPv4
  168. try {
  169. Dns.GetHostAddresses ("0.0.0.0");
  170. Assert.Fail ("#A1");
  171. } catch (ArgumentException ex) {
  172. // IPv4 address 0.0.0.0 and IPv6 address ::0 are
  173. // unspecified addresses that cannot be used as
  174. // a target address
  175. Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#A2");
  176. Assert.IsNull (ex.InnerException, "#A3");
  177. Assert.IsNotNull (ex.Message, "#A4");
  178. Assert.AreEqual ("hostNameOrAddress", ex.ParamName, "#A5");
  179. }
  180. // IPv6
  181. try {
  182. Dns.GetHostAddresses ("::0");
  183. Assert.Fail ("#B1");
  184. } catch (ArgumentException ex) {
  185. // IPv4 address 0.0.0.0 and IPv6 address ::0 are
  186. // unspecified addresses that cannot be used as
  187. // a target address
  188. Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#B2");
  189. Assert.IsNull (ex.InnerException, "#B3");
  190. Assert.IsNotNull (ex.Message, "#B4");
  191. Assert.AreEqual ("hostNameOrAddress", ex.ParamName, "#B5");
  192. }
  193. }
  194. [Test]
  195. public void GetHostName ()
  196. {
  197. string hostName = Dns.GetHostName ();
  198. Assert.IsNotNull (hostName);
  199. }
  200. [Test]
  201. #if FEATURE_NO_BSD_SOCKETS
  202. [ExpectedException (typeof (PlatformNotSupportedException))]
  203. #endif
  204. public void GetHostByName ()
  205. {
  206. SubTestGetHostByName (site1Name, site1Dot);
  207. SubTestGetHostByName (site2Name, site2Dot);
  208. try {
  209. var entry = Dns.GetHostByName (noneExistingSite);
  210. /*
  211. * Work around broken t-online.de DNS Server.
  212. *
  213. * T-Online's DNS Server for DSL Customers resolves
  214. * non-exisitng domain names to
  215. * http://navigationshilfe1.t-online.de/dnserror?url=....
  216. * instead of reporting an error.
  217. */
  218. var navigationshilfe1 = IPAddress.Parse ("80.156.86.78");
  219. var navigationshilfe2 = IPAddress.Parse ("62.157.140.133");
  220. foreach (var addr in entry.AddressList) {
  221. if (addr.Equals (navigationshilfe1) || addr.Equals (navigationshilfe2))
  222. return;
  223. }
  224. Assert.Fail ("Should raise a SocketException (assuming that '" + noneExistingSite + "' does not exist)");
  225. } catch (SocketException) {
  226. }
  227. }
  228. static IPAddress GetIPv4Address (IPHostEntry h)
  229. {
  230. var al = h.AddressList.FirstOrDefault (x => x.AddressFamily == AddressFamily.InterNetwork);
  231. if (al == null)
  232. Assert.Ignore ("Could not resolve an IPv4 address as required by this test case, e.g. running on an IPv6 only network");
  233. return al;
  234. }
  235. void SubTestGetHostByName (string siteName, string siteDot)
  236. {
  237. IPHostEntry h = Dns.GetHostByName (siteName);
  238. SubTestValidIPHostEntry (h);
  239. Assert.AreEqual (siteName, h.HostName, "siteName");
  240. var ip = GetIPv4Address (h);
  241. Assert.AreEqual (siteDot, ip.ToString (), "siteDot");
  242. }
  243. [Test]
  244. public void GetHostByName_HostName_Null ()
  245. {
  246. try {
  247. Dns.GetHostByName ((string) null);
  248. Assert.Fail ("#1");
  249. } catch (ArgumentNullException ex) {
  250. Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2");
  251. Assert.IsNull (ex.InnerException, "#3");
  252. Assert.IsNotNull (ex.Message, "#4");
  253. Assert.AreEqual ("hostName", ex.ParamName, "#5");
  254. }
  255. }
  256. [Test]
  257. public void GetHostByAddressString_Address_Null ()
  258. {
  259. try {
  260. Dns.GetHostByAddress ((string) null);
  261. Assert.Fail ("#1");
  262. } catch (ArgumentNullException ex) {
  263. Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2");
  264. Assert.IsNull (ex.InnerException, "#3");
  265. Assert.IsNotNull (ex.Message, "#4");
  266. Assert.AreEqual ("address", ex.ParamName, "#5");
  267. }
  268. }
  269. [Test]
  270. [ExpectedException (typeof (SocketException))]
  271. public void GetHostByAddressString2 ()
  272. {
  273. Dns.GetHostByAddress ("123.255.23");
  274. }
  275. [Test]
  276. [ExpectedException (typeof (FormatException))]
  277. public void GetHostByAddressString3 ()
  278. {
  279. Dns.GetHostByAddress ("123.256.34.10");
  280. }
  281. [Test, ExpectedException (typeof (FormatException))]
  282. public void GetHostByAddressString4 ()
  283. {
  284. Dns.GetHostByAddress ("not an IP address");
  285. }
  286. [Test]
  287. public void GetHostByAddressString5 ()
  288. {
  289. Dns.GetHostByAddress (site1Dot);
  290. }
  291. [Test]
  292. public void GetHostByAddressIPAddress_Address_Null ()
  293. {
  294. try {
  295. Dns.GetHostByAddress ((IPAddress) null);
  296. Assert.Fail ("#1");
  297. } catch (ArgumentNullException ex) {
  298. Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2");
  299. Assert.IsNull (ex.InnerException, "#3");
  300. Assert.IsNotNull (ex.Message, "#4");
  301. Assert.AreEqual ("address", ex.ParamName, "#5");
  302. }
  303. }
  304. [Test]
  305. public void GetHostByAddressIPAddress2 ()
  306. {
  307. IPAddress addr = new IPAddress (IPAddress.NetworkToHostOrder ((int) site1IP));
  308. IPHostEntry h = Dns.GetHostByAddress (addr);
  309. SubTestValidIPHostEntry (h);
  310. var ip = GetIPv4Address (h);
  311. Assert.AreEqual (addr.ToString (), ip.ToString ());
  312. }
  313. [Test]
  314. public void GetHostByAddressIPAddress3 ()
  315. {
  316. IPAddress addr = new IPAddress (IPAddress.NetworkToHostOrder ((int) site2IP));
  317. IPHostEntry h = Dns.GetHostByAddress (addr);
  318. SubTestValidIPHostEntry (h);
  319. var ip = GetIPv4Address (h);
  320. Assert.AreEqual (addr.ToString (), ip.ToString ());
  321. }
  322. [Test]
  323. #if FEATURE_NO_BSD_SOCKETS
  324. [ExpectedException (typeof (PlatformNotSupportedException))]
  325. #endif
  326. public void BeginResolve_HostName_Null ()
  327. {
  328. try {
  329. Dns.BeginResolve ((string) null,
  330. new AsyncCallback (ShouldntBeCalled),
  331. null);
  332. Assert.Fail ("#1");
  333. } catch (ArgumentNullException ex) {
  334. Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2");
  335. Assert.IsNull (ex.InnerException, "#3");
  336. Assert.IsNotNull (ex.Message, "#4");
  337. Assert.AreEqual ("hostName", ex.ParamName, "#5");
  338. }
  339. }
  340. [Test]
  341. #if FEATURE_NO_BSD_SOCKETS
  342. [ExpectedException (typeof (PlatformNotSupportedException))]
  343. #endif
  344. public void Resolve ()
  345. {
  346. SubTestResolve (site1Name);
  347. SubTestResolve (site2Name);
  348. SubTestResolve (site1Dot);
  349. SubTestResolve (site2Dot);
  350. }
  351. void SubTestResolve (string addr)
  352. {
  353. IPHostEntry h = Dns.Resolve (addr);
  354. SubTestValidIPHostEntry (h);
  355. }
  356. [Test]
  357. #if FEATURE_NO_BSD_SOCKETS
  358. [ExpectedException (typeof (PlatformNotSupportedException))]
  359. #endif
  360. public void Resolve_HostName_Null ()
  361. {
  362. try {
  363. Dns.Resolve ((string) null);
  364. Assert.Fail ("#1");
  365. } catch (ArgumentNullException ex) {
  366. Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2");
  367. Assert.IsNull (ex.InnerException, "#3");
  368. Assert.IsNotNull (ex.Message, "#4");
  369. Assert.AreEqual ("hostName", ex.ParamName, "#5");
  370. }
  371. }
  372. [Test] // BeginGetHostEntry (IPAddress, AsyncCallback, Object)
  373. #if FEATURE_NO_BSD_SOCKETS
  374. [ExpectedException (typeof (PlatformNotSupportedException))]
  375. #endif
  376. public void BeginGetHostEntry1_Address_Null ()
  377. {
  378. try {
  379. Dns.BeginGetHostEntry (
  380. (IPAddress) null,
  381. new AsyncCallback (ShouldntBeCalled),
  382. null);
  383. Assert.Fail ("#1");
  384. } catch (ArgumentNullException ex) {
  385. Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2");
  386. Assert.IsNull (ex.InnerException, "#3");
  387. Assert.IsNotNull (ex.Message, "#4");
  388. Assert.AreEqual ("address", ex.ParamName, "#5");
  389. }
  390. }
  391. [Test] // BeginGetHostEntry (String, AsyncCallback, Object)
  392. #if FEATURE_NO_BSD_SOCKETS
  393. [ExpectedException (typeof (PlatformNotSupportedException))]
  394. #endif
  395. public void BeginGetHostEntry2_HostNameOrAddress_Null ()
  396. {
  397. try {
  398. Dns.BeginGetHostEntry (
  399. (string) null,
  400. new AsyncCallback (ShouldntBeCalled),
  401. null);
  402. Assert.Fail ("#1");
  403. } catch (ArgumentNullException ex) {
  404. Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2");
  405. Assert.IsNull (ex.InnerException, "#3");
  406. Assert.IsNotNull (ex.Message, "#4");
  407. Assert.AreEqual ("hostName", ex.ParamName, "#5");
  408. }
  409. }
  410. [Test] // BeginGetHostEntry (String, AsyncCallback, Object)
  411. #if FEATURE_NO_BSD_SOCKETS
  412. [ExpectedException (typeof (PlatformNotSupportedException))]
  413. #endif
  414. public void BeginGetHostEntry2_HostNameOrAddress_UnspecifiedAddress ()
  415. {
  416. // IPv4
  417. try {
  418. Dns.BeginGetHostEntry (
  419. "0.0.0.0",
  420. new AsyncCallback (GetHostEntryCallback),
  421. null);
  422. Assert.Fail ("#1");
  423. } catch (ArgumentException ex) {
  424. // IPv4 address 0.0.0.0 and IPv6 address ::0 are
  425. // unspecified addresses that cannot be used as
  426. // a target address
  427. Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#2");
  428. Assert.IsNull (ex.InnerException, "#3");
  429. Assert.IsNotNull (ex.Message, "#4");
  430. Assert.AreEqual ("hostNameOrAddress", ex.ParamName, "#5");
  431. }
  432. // IPv6
  433. try {
  434. Dns.BeginGetHostEntry (
  435. "::0",
  436. new AsyncCallback (GetHostEntryCallback),
  437. null);
  438. Assert.Fail ("#1");
  439. } catch (ArgumentException ex) {
  440. // IPv4 address 0.0.0.0 and IPv6 address ::0 are
  441. // unspecified addresses that cannot be used as
  442. // a target address
  443. Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#2");
  444. Assert.IsNull (ex.InnerException, "#3");
  445. Assert.IsNotNull (ex.Message, "#4");
  446. Assert.AreEqual ("hostNameOrAddress", ex.ParamName, "#5");
  447. }
  448. }
  449. void GetHostEntryCallback (IAsyncResult ar)
  450. {
  451. IPHostEntry hostEntry = Dns.EndGetHostEntry (ar);
  452. Assert.IsNotNull (hostEntry);
  453. }
  454. [Test] // GetHostEntry (IPAddress)
  455. public void GetHostEntry1_Address_Null ()
  456. {
  457. try {
  458. Dns.GetHostEntry ((IPAddress) null);
  459. Assert.Fail ("#1");
  460. } catch (ArgumentNullException ex) {
  461. Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2");
  462. Assert.IsNull (ex.InnerException, "#3");
  463. Assert.IsNotNull (ex.Message, "#4");
  464. Assert.AreEqual ("address", ex.ParamName, "#5");
  465. }
  466. }
  467. [Test] // GetHostEntry (String)
  468. #if FEATURE_NO_BSD_SOCKETS
  469. [ExpectedException (typeof (PlatformNotSupportedException))]
  470. #endif
  471. public void GetHostEntry2 ()
  472. {
  473. Dns.GetHostEntry (site1Name); // hostname
  474. Dns.GetHostEntry (site1Dot); // IP address
  475. }
  476. [Test] // GetHostEntry (String)
  477. public void GetHostEntry2_HostNameOrAddress_Null ()
  478. {
  479. try {
  480. Dns.GetHostEntry ((string) null);
  481. Assert.Fail ("#1");
  482. } catch (ArgumentNullException ex) {
  483. Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2");
  484. Assert.IsNull (ex.InnerException, "#3");
  485. Assert.IsNotNull (ex.Message, "#4");
  486. Assert.AreEqual ("hostNameOrAddress", ex.ParamName, "#5");
  487. }
  488. }
  489. [Test] // GetHostEntry (String)
  490. public void GetHostEntry2_HostNameOrAddress_UnspecifiedAddress ()
  491. {
  492. // IPv4
  493. try {
  494. Dns.GetHostEntry ("0.0.0.0");
  495. Assert.Fail ("#A1");
  496. } catch (ArgumentException ex) {
  497. // IPv4 address 0.0.0.0 and IPv6 address ::0 are
  498. // unspecified addresses that cannot be used as
  499. // a target address
  500. Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#A2");
  501. Assert.IsNull (ex.InnerException, "#A3");
  502. Assert.IsNotNull (ex.Message, "#A4");
  503. Assert.AreEqual ("hostNameOrAddress", ex.ParamName, "#A5");
  504. }
  505. // IPv6
  506. try {
  507. Dns.GetHostEntry ("::0");
  508. Assert.Fail ("#B1");
  509. } catch (ArgumentException ex) {
  510. // IPv4 address 0.0.0.0 and IPv6 address ::0 are
  511. // unspecified addresses that cannot be used as
  512. // a target address
  513. Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#B2");
  514. Assert.IsNull (ex.InnerException, "#B3");
  515. Assert.IsNotNull (ex.Message, "#B4");
  516. Assert.AreEqual ("hostNameOrAddress", ex.ParamName, "#B5");
  517. }
  518. }
  519. void SubTestValidIPHostEntry (IPHostEntry h)
  520. {
  521. Assert.IsNotNull (h.HostName, "HostName not null");
  522. Assert.IsNotNull (h.AddressList, "AddressList not null");
  523. Assert.IsTrue (h.AddressList.Length > 0, "AddressList.Length");
  524. }
  525. [Test]
  526. public void GetHostEntry_StringEmpty ()
  527. {
  528. Dns.GetHostEntry (string.Empty);
  529. }
  530. /* This isn't used anymore, but could be useful for debugging
  531. static void printIPHostEntry(IPHostEntry h)
  532. {
  533. Console.WriteLine("----------------------------------------------------");
  534. Console.WriteLine("Host name:");
  535. Console.WriteLine(h.HostName);
  536. Console.WriteLine("IP addresses:");
  537. IPAddress[] list = h.AddressList;
  538. for(int i = 0; i < list.Length; ++i)
  539. Console.WriteLine(list[i]);
  540. Console.WriteLine("Aliases:");
  541. string[] aliases = h.Aliases;
  542. for(int i = 0; i < aliases.Length; ++i)
  543. Console.WriteLine(aliases[i]);
  544. Console.WriteLine("----------------------------------------------------");
  545. }
  546. */
  547. }
  548. }