As huaiyuan mentioned, you ned to modify your syntax table.
That said, what he posted modifies the current table...
Each language has a syntax table, e.g. For c++, you could do
(modify-syntax-entry ?_ "w" c++-mode-syntax-table)
I don't know what "your c# mode" uses, but a quick M-x apropos
with a look up of syntax-table
should help you find out...
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…