惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Fortinet All Blogs
Attack and Defense Labs
Attack and Defense Labs
V2EX - 技术
V2EX - 技术
O
OpenAI News
S
Secure Thoughts
H
Heimdal Security Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Schneier on Security
Schneier on Security
H
Hacker News: Front Page
S
Security Affairs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Vercel News
Vercel News
Microsoft Security Blog
Microsoft Security Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
The Register - Security
The Register - Security
GbyAI
GbyAI
Cloudbric
Cloudbric
MongoDB | Blog
MongoDB | Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
K
Kaspersky official blog
Forbes - Security
Forbes - Security
Y
Y Combinator Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
Scott Helme
Scott Helme
Hacker News - Newest:
Hacker News - Newest: "LLM"
The Cloudflare Blog
Recorded Future
Recorded Future
人人都是产品经理
人人都是产品经理
Cyberwarzone
Cyberwarzone
C
CERT Recently Published Vulnerability Notes
Webroot Blog
Webroot Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
L
LangChain Blog
T
Tor Project blog
Microsoft Azure Blog
Microsoft Azure Blog
博客园_首页
Hacker News: Ask HN
Hacker News: Ask HN
Blog — PlanetScale
Blog — PlanetScale
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog RSS Feed
N
News and Events Feed by Topic
阮一峰的网络日志
阮一峰的网络日志
I
Intezer
V
V2EX
T
Tailwind CSS Blog
SecWiki News
SecWiki News
NISL@THU
NISL@THU
C
Check Point Blog

博客园 - czh

基于MDB_ICP协议的纸币识别器与自动售货机通讯的研究 Mobile Network auto-Connection How could you login to ms sql server if you lost system admin password to setup windows auto-login Compile DLLs referenced into exe/dll 族谱软件系统的使用介绍 javascript在vs2003中调试随笔和javascript使用小总结[转载] 世界互联网正处于剧变前夜! 系统分析师 考试 DVD playable asp.net 页面事件:顺序与回传 创业还是读研? Window消息大全 关于STRONG NAME 好东西 一名25岁的董事长给大学生的18条忠告(不想虚度年华的进来) ZT SQL*PLUS命令的使用大全 如何做一个增加系统DSN的过程 ASP连接11种数据库语法总结
C#判断文件名是否合法
czh · 2006-08-15 · via 博客园 - czh

C#判断文件名是否合法,如下

    private bool IsFileNameValid(string name)
    {
             bool isFilename = true;
            string[] errorStr =new string []{"/","\\",":",",","*","?","\"","<",">","|"};

            if (string.IsNullOrEmpty(name))
            {
                isFilename= false ;
            }
            else
            {
                for(int i=0;i<errorStr .Length ;i++)
                {
                    if(name.Contains (errorStr[i]))
                    {
                        isFilename = false;
                        break;
                    }
                }
            }
        return isFilename;
    }