\documentclass[a4paper, 11pt]{article}
\renewcommand{\familydefault}{\sfdefault}
\usepackage{a4wide}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{color}
\usepackage{graphicx}
\usepackage{setspace}
\usepackage{ulem}
\usepackage{listings}
\usepackage{float}
\usepackage[rflt]{floatflt}
\usepackage{tabularx}
\setlength{\parindent}{0pt}
\title{C# Browscap Version}
\usepackage[
pdftitle={C# Browscap Version}
pdfsubject={An experimental realization of a class to use the browscap.ini with C#.}
pdfauthor={Udo Schmal}
pdfkeywords={Browscap.ini, Browscap, C#, CSharp}
]{hyperref}
\definecolor{darkblue}{rgb}{0,0,.5}
\hypersetup{pdftex=true, colorlinks=true, breaklinks=true, linkcolor=darkblue, menucolor=darkblue, pagecolor=darkblue, urlcolor=darkblue}
\begin{document}C\# Browscap Version
\singlespacing
{\LARGE \textbf{\label{sec:title}C\# Browscap Version}}

I made a little test with a first C\# parser as ConsoleApplication, witch uses Windows native methods, i think C\# has no own INI class (if someone knows a better way, please tell us):

 For loading the 48048 sections in an array and sort them by length (descending) it takes 796 ms (I think that's ok, because the loading should only happen once), on a search of \&quot;Mozilla/5.0 (Windows NT 6.1; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0\&quot; the match [Mozilla/5.0 (Windows NT 6.1*WOW64) Gecko/* Firefox/28.0*] was found in 811ms (I think that's bad)\newline
 to get the values and copy them to a NameValueCollection it takes 203 ms (that's very bad)

I think the only way to do that with C\# is to write an INI-File Class for C\# and also write a little function as replacement for the regular expressions.

\textbf{The following version is only my test version, not all \label{sec:result_box}necessary measures for the proper processing were implemented!}

ToDo / known issues:

\begin{enumerate}
\item Replace the RegExp method with a faster like in my free pascal version
\item Replace the kernel32 implementation of ini-file methods by a native C\# class
\item Check for match without comparing numbers
\end{enumerate}

\href{https://www.gocher.me/code/browscap.cs}{browscap.cs}

\textbf{Anwendungbeispiel:}

\href{https://www.gocher.me/code/Program.cs}{Program.cs}

\textbf{Output: }
\begin{lstlisting}[breaklines]load 57907 sections in 796 ms
search : [Mozilla/5.0 (Windows NT 6.1; WOW64; rv:28.0) Gecko/20100101 Firefox/28.0]
Mozilla/5.0 (*Windows NT 6.1*WOW64*) Gecko* Firefox/28.0*:
\textasciicircumMozilla/5\textbackslash.0\textbackslash \textbackslash(.*Windows\textbackslash NT\textbackslash 6\textbackslash.1.*WOW64.*\textbackslash)\textbackslash Gecko.*\textbackslash Firefox/28\textbackslash.0.*\$
find match: [Mozilla/5.0 (*Windows NT 6.1*WOW64*) Gecko* Firefox/28.0*] in 811 ms
get values: 203 ms
Browser\_Bits=32
Platform=Win7
Platform\_Version=6.1
Platform\_Description=Windows 7
Platform\_Bits=64
Platform\_Maker=Microsoft Corporation
Win32=false
Win64=true
Device\_Name=Windows Desktop
Device\_Code\_Name=Windows Desktop
Comment=Firefox 28.0
Browser=Firefox
Browser\_Type=Browser
Browser\_Maker=Mozilla Foundation
Version=28.0
MajorVer=28
Frames=true
IFrames=true
Tables=true
Cookies=true
JavaScript=true
JavaApplets=true
CssVersion=3
Device\_Maker=Various
Device\_Type=Desktop
Device\_Pointing\_Method=mouse
RenderingEngine\_Name=Gecko
RenderingEngine\_Version=28.0
RenderingEngine\_Description=For Firefox, Camino, K-Meleon, SeaMonkey, Netscape, and other Gecko-based browsers.
RenderingEngine\_Maker=Mozilla Foundation
Browser\_Modus=unknown
MinorVer=0
Alpha=false
Beta=false
Win16=false
BackgroundSounds=false
VBScript=false
ActiveXControls=false
isMobileDevice=false
isTablet=false
isSyndicationReader=false
Crawler=false
AolVersion=0
Device\_Brand\_Name=unknown\newline
\end{lstlisting}
\end{document}