بالاخره پیدا کردم ... :)
این کد مورد نیاز :
\documentclass{article}
\usepackage{xcolor}
\usepackage{color}
\definecolor{bluekeywords}{rgb}{0.13,0.13,1}
\definecolor{greencomments}{rgb}{0,0.5,0}
\definecolor{redstrings}{rgb}{0.9,0,0}
\definecolor{mygray}{gray}{0.9}
\usepackage{listings}
\lstset{
language=[Sharp]C, % choose the language of the code
numbers=left,
basicstyle=\fontfamily{pcr}\selectfont\footnotesize\color{black},
keywordstyle=\color{bluekeywords},
stringstyle=\color{redstrings},
commentstyle=\color{greencomments},
numberstyle=\tiny, % the size of the fonts that are used for the line-numbers
backgroundcolor=\color{mygray},
showspaces=false, % show spaces adding particular underscores
showstringspaces=false, % underline spaces within strings
showtabs=false, % show tabs within strings adding particular underscores
frame=single, % adds a frame around the code
tabsize=2, % sets default tabsize to 2 spaces
rulesepcolor=\color{gray},
rulecolor=\color{black},
captionpos=b, % sets the caption-position to bottom
breaklines=true, % sets automatic line breaking
breakatwhitespace=false,
}
\begin{document}
\begin{lstlisting}
code here
\end{lstlisting}
\end{document}
و این خروجی دلخواه