DetectionLogic detectionLogic = new DetectionLogic(); //Trial Mode
//DetectionLogic detectionLogic = new DetectionLogic("place user name here", "place license key here"); //License Mode
//Parameters
string userAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25";
DeviceInformation info = detectionLogic.DetectDevice(userAgent);
//Write out everything at once
Console.WriteLine(info.ToString());
//Write out individual properties
Console.WriteLine(info.UserAgent);
Console.WriteLine(info.EasyBrowser);
Console.WriteLine(info.EasyPlatform);
Console.WriteLine(info.BrowserType);
Console.WriteLine(info.IsTouch);
Console.WriteLine(info.BrowserName);
Console.WriteLine(info.BrowserVersion);
Console.WriteLine(info.BrandName);
Console.WriteLine(info.Identifier);
Console.WriteLine(info.ModelName);
Console.WriteLine(info.ModelNumber);
Console.WriteLine(info.OperatingSystem);
Console.WriteLine(info.OperatingSystemVersion);
Console.WriteLine(info.ProcessorType);
Console.WriteLine(info.Culture);
Console.WriteLine(info.LayoutEngine);
Console.WriteLine(info.LayoutEngineVersion);
Console.WriteLine(info.SecurityLevel);
foreach (var browserProperty in info.BrowserProperties)
{
Console.WriteLine("{0} {1} {2}: {3}", browserProperty.Category,
browserProperty.CategoryVersion,
browserProperty.Capability,
browserProperty.HasCapability);
}
foreach (var modelProperty in info.ModelProperties)
{
Console.WriteLine("Model Property {0}: {1}", modelProperty.Property, modelProperty.PropertyValue);
}
UserAgentValidLogic userAgentValidLogic = new UserAgentValidLogic();
//Parameters
string userAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5376e Safari/8536.25";
string result = userAgentValidLogic.UserAgentValid(userAgent);
Console.WriteLine("User Agent: " + userAgent);
if (string.IsNullOrEmpty(result))
Console.WriteLine("Was Valid");
Console.WriteLine();
userAgent = "john.doe@hotmail.com";
result = userAgentValidLogic.UserAgentValid(userAgent);
Console.WriteLine("User Agent: " + userAgent);
if (!string.IsNullOrEmpty(result))
Console.WriteLine(result);