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

推荐订阅源

H
Hackread – Cybersecurity News, Data Breaches, AI and More
C
Check Point Blog
Hacker News: Ask HN
Hacker News: Ask HN
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
WordPress大学
WordPress大学
P
Proofpoint News Feed
V
Visual Studio Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
N
Netflix TechBlog - Medium
C
CXSECURITY Database RSS Feed - CXSecurity.com
博客园 - 聂微东
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
博客园 - 叶小钗
Cisco Talos Blog
Cisco Talos Blog
S
Schneier on Security
T
Threat Research - Cisco Blogs
腾讯CDC
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
The Hacker News
The Hacker News
Google DeepMind News
Google DeepMind News
Microsoft Security Blog
Microsoft Security Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
GbyAI
GbyAI
N
News | PayPal Newsroom
L
LINUX DO - 最新话题
酷 壳 – CoolShell
酷 壳 – CoolShell
P
Palo Alto Networks Blog
T
Tenable Blog
S
Secure Thoughts
T
Threatpost
V2EX - 技术
V2EX - 技术
大猫的无限游戏
大猫的无限游戏
Martin Fowler
Martin Fowler
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Vercel News
Vercel News
罗磊的独立博客
P
Privacy & Cybersecurity Law Blog
Engineering at Meta
Engineering at Meta
小众软件
小众软件
Google DeepMind News
Google DeepMind News
N
News and Events Feed by Topic
Y
Y Combinator Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
C
Cybersecurity and Infrastructure Security Agency CISA
P
Proofpoint News Feed
L
Lohrmann on Cybersecurity
P
Privacy International News Feed
H
Heimdal Security Blog
量子位
B
Blog

博客园 - 嚣张的沉默

读写txt文档 限制TextBox输入字数 计算TextBox输入的字数 我常用的正则与SQL语句 DataSet导入到Excel 年月日联动的JS代码 用户控件的传值方法 Repeater模板列 asp.net的几个小技巧 百叶窗效果 建站安全 倒计时代码 解决SQL2000安装服务器挂起 删除.NET的最近项目 屏幕右下角弹出广告 DataSet写入、导出XML 自动跳转页面带参数 微软出的AJAX控件的安装(转载) 第一次开博
上传图片重命名并创建文件夹
嚣张的沉默 · 2007-10-24 · via 博客园 - 嚣张的沉默

上传图片重命名并创建文件夹

string strFileName1 = FileUpload1.FileName;//取到上传文件的名称
        string[] myfile = strFileName1.Split('.');//把文件名与文件类型分开
        string dotname = myfile[myfile.Length - 1].ToString().ToLower();//得到文件类型
        Random myrdn = new Random();//产生随机数
        strFileName1 = DateTime.Now.ToString("yyMMddHHmm"+ myrdn.Next(10000).ToString() + "." + dotname;
        
string imgpath = Server.MapPath("~/Images/");
        
string folder = "bb";//创建的文件夹名称

        
if (!System.IO.Directory.Exists(imgpath + folder))
        
{//自动生成文件夹
            System.IO.Directory.CreateDirectory(imgpath + folder);
        }

        FileUpload1.SaveAs(imgpath 
+ folder+"\\" + strFileName1);

posted on 2007-10-24 15:56  嚣张的沉默  阅读(484)  评论(0)    收藏  举报

刷新页面返回顶部