过滤危险字符

string regEx = "[`~!@#$%^&*()-+=|{}':;',\[\].<>/?~!@#¥%……&*()——+|{}【】‘;:”“’。,、?•]";
string result = Regex.Replace(name, regEx, "");

原文地址:https://www.cnblogs.com/zwei1121/p/3512513.html