'Usage
Dim instance As UserAgentValidLogic Dim userAgent As String Dim value As String value = instance.UserAgentValid(userAgent)
Parameters
- userAgent
- The user agent.
Return Value
string.Empty or validation message
'Usage
Dim instance As UserAgentValidLogic Dim userAgent As String Dim value As String value = instance.UserAgentValid(userAgent)
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);
Dim userAgentValidLogic As New UserAgentValidLogic() 'Parameters Dim userAgent As String = "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" Dim result As String = userAgentValidLogic.UserAgentValid(userAgent) Console.WriteLine("User Agent: " & userAgent) If String.IsNullOrEmpty(result) Then Console.WriteLine("Was Valid") End If Console.WriteLine() userAgent = "john.doe@hotmail.com" result = userAgentValidLogic.UserAgentValid(userAgent) Console.WriteLine("User Agent: " & userAgent) If Not String.IsNullOrEmpty(result) Then Console.WriteLine(result) End If
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2