string English_pattern = "^([\u0000-\u007F]+)*$"; string Noallowed_pattern = "^[^*?<>:\\//|]*$"; string content = userFile.FileName; if (!Regex.IsMatch(content, English_pattern) || !Regex.IsMatch(content, Noallowed_pattern)) { //English } else { Non-English }
No comments:
Post a Comment