danesparza / domainname-parser

:department_store: .NET domain name parsing library (uses publicsuffix.org)
MIT License
35 stars 19 forks source link

The issue is I am stuck! I believe the app to be fine - #2

Closed madriver closed 9 years ago

madriver commented 9 years ago

First off - thank you very much for posting this app. And excuse if asking this question is not appropriate!

Bottom line is your app will be perfect for my needs but I just cannot get it to parse a domain name. I am in Visual Studio 2012; installed via NuGet without issue. downloaded the publicsuffix.org ruleset and pointed to it in app.config. Below is my sample test code in VB.net. So my question is how can I debug the failure? As an example is the app happy with the publicsuffix.org file - either format wise or? Since no errors it would seem like that maybe is the issue? Can I declare the source file directly in the code rather than in app.config? Any other idea's for me to troubleshoot? Again - thank you.

Imports System.Windows.Forms Module Module1 Sub Main() Dim outDomain As DomainName.Library.DomainName = Nothing ' Try parsing a 'wildcard' domain If DomainName.Library.DomainName.TryParse("photos.verybritish.co.uk", outDomain) Then ' The domain should be parsed as 'verybritish' MessageBox.Show("Domain = " & outDomain.Domain.ToString) ' The TLD is 'co.uk' MessageBox.Show("TLD = " & outDomain.TLD.ToString) 'Assert.AreEqual("co.uk", outDomain.TLD) ' The SLD is just an alias for 'Domain': MessageBox.Show("SLD = " & outDomain.SLD.ToString) ' The subdomain is everything else to the left of the domain: MessageBox.Show("subdomain = " & outDomain.SubDomain.ToString) Else MessageBox.Show("Apparently, we couldn't parse photos.verybritish.co.uk") End If End Sub