Moving Application Keys to Web.config In ASP.NET Facebook applications

Create the following entries in your web.config file.

 <appSettings>
        <add key="ApiKey" value="YOUR_FACEBOOK_API_KEY" />
        <add key="Secret" value="YOUR_FACEBOOK_SECRET" />
   </appSettings>

Then from your code behind set the 2 values as follows:

base.Api = ConfigurationManager.AppSettings["ApiKey"] as String;
base.Secret = ConfigurationManager.AppSettings["Secret"] as String;

How to check IP Address Validity in C#

Have you ever scrambled around retying to validate an IP Address in C#?

Here’s another way:

private bool isValidIPAddress(string ip)
{
IPAddress address;
return IPAddress.TryParse(ip, out address);
}

Next Page →