.net - Convert string to current culture in c# -


i have instance of "windows firewall" windows service, using

servicecontroller service = new servicecontroller("windows firewall"); 

this works fine in en-us culture, when try in windows portuguese(brazil) pt-pt culture, throws exception service not found.

yes, in portuguese there no "windows firewall" instead "firewall windows", if change code below

servicecontroller service = new servicecontroller("firewall windows");  

it work in pt-pt culture.

is there generic way, "windows firewall" instance irrespective of culture?

there's no system provided function perform such conversion. you'd have create list/dictionary of possible values in own code, , value.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -