Commit e8774519 authored by Damon's avatar Damon

增加对中文路径的限制

parent 4b35f49e
using System;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Windows;
using System.Windows.Controls;
......@@ -31,6 +32,11 @@ namespace Dqkj.Setup
MessageBox.Show("请选择安装路径!", "温馨提示");
return;
}
if (new Regex(@"[\u4e00-\u9fa5]+").IsMatch(txtPath.Text))
{
MessageBox.Show("路径名只能包含英文或数字!", "温馨提示");
return;
}
if (!Path.GetInvalidFileNameChars().Any(c => txtPath.Text.Contains(c)))
{
MessageBox.Show("非法路径,请重新填写或者选择路径!", "温馨提示");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment