Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
S
Setup
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄树航
Setup
Commits
e8774519
Commit
e8774519
authored
May 04, 2023
by
Damon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加对中文路径的限制
parent
4b35f49e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
InstallView.xaml.cs
View/InstallView.xaml.cs
+6
-0
No files found.
View/InstallView.xaml.cs
View file @
e8774519
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
(
"非法路径,请重新填写或者选择路径!"
,
"温馨提示"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment