通过本文主要向大家介绍了c语言,欲情 c max,维生素c,crh2c,奔驰c200等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
文件路径或者保存模板出现非法字符判断
1)不为空判断
string strTemplateName = txtTemplateName.Text;
if (string.IsNullOrWhiteSpace(strTemplateName))
{
Show("请输入模板名称!", "提示", .Information, OK);
txtTemplateName.Focus();
return;
}
</div>
2)然后对strTemplateName 进行非法字符判断
if (strTemplateName.IndexOfAny(Path.GetInvalidFileNameChars()) >= 0)
{
//含有非法字符 \ / : * ? " < > | 等
Show("模板名称含有非法字符,请重新输入", "错误", Error, OK);
txtTemplateName.Focus();
return;
}
</div>
3)path 引用系统的io 动态库即可。

