If you read the first couple of paragraphs of this here (until "See also"):
http://en.wikipedia.org/wiki/S-Box[
^] you'll know exactly what to do.
What kind of an S-Box do you want BTW? A 6 x 4 or what. Please specify, think about it and if you still have problems with it please leave me a comment and I'll see what I can do for you.
Hint: An S-Box is a nxm matrix. Actually this makes it a nxm array in C# terms.
Happy coding!
-MRB