Open Source DNS Lookup Library using C#

This example contains an open source DNS Lookup library and an example of using it to look up Txt Records.

More



Get Local DNS Server Address using C#

In this example we will get the DNS server address that is configured on your local network adapter. Start by getting all the Network Interfaces, loop over them to find one which has an OperationalStatus of Up, then get the IPInterfaceProperties of the active NetworkInterface, then get the DNS Addresses from the IPInterfaceProperties and then return the first value.

More



Get XML Sitemap Urls using XPath and C#

In this example we will get the all the Urls from an XML Sitemap using XPath. First you need to load the sitemap xml file using an XmlTextReader by passing in the Url location of the sitemap, then use the XmlReader create an XPathDocument, which creates an XPathNavigator.

More



Shrink MS SQL Server Databases

In this example we will shrink the size of a Microsoft SQL Database. We do this by using the command DBCC SHRINKFILE. To find out the size of a database use the stored procedure sp_spaceused

More



Get MS SQL Database Table Sizes

In this example we will get the sizes of each table within an Microsoft SQL database. We do this by creating a temporary table and then running the stored procedure sp_MSforeachtable to call the stored procedure sp_spaceused, insert the output into the temporary table and then select the results.

More



Access Secure Feed with SyndicationFeed

In this example we are going to access a secure RSS feed using SyndicationFeed. This is done by setting the NetworkCredentials in the XmlUrlResolver, and then setting the XmlUrlResolver in the XmlReaderSettings and finally passing the XmlReaderSettings into the XmlReader.Create() method.

More



Getting DNS TXT Record using C#

In this example we will get the DNS TXT Record for a given hostname using C# to run nslookup at the command line.

More