可以考虑用DateTime.ToFileTime 方法,
该值为自 1601 年 1 月 1 日午夜 12:00 以来所经过时间以 100 毫微秒为间隔表示时的数字。
该值为自 1601 年 1 月 1 日午夜 12:00 以来所经过时间以 100 毫微秒为间隔表示时的数字。
解决方案 »
- 怎么用ASP.NET的验证控件实现这样的验证?
- 有关asp.net的几个问题。
- 水晶报表dataset中放两个表时产生错误
- 超高分求解!FineReport报表如何与asp.net配置
- asp.net 通过鼠标连续点击生成热区,产生链接,怎么实现?
- IP访问不了IIS上的站点
- 太奇怪了,JS的数组
- 做一个程序通过某个网址,用程序截取网页的样子转成图片保存?
- 如何在aspnet中用梅花雪的treeview控件啊?或者有别的适合于ie5.0以上的treeview吗?
- 再次发帖请教高手!奇怪的问题:为什么没有在dataset里面数据,也有数据显示呢?
- 我如何才能够体会到。net平台上web开发中xml的好处呢??
- 关于.net中收邮件,请高手指点
use System.IO.Directory.Exists("YourDirPath")>>>遇到文件名已经存在。就累加1如何操作?
if those files are only created by your application, consider something like:lock something so only one instance of your application or thread can access
search for the file name whose last four digits are the largest
add 1 to the number
create the new file with the new number
unlock the thing you locked earlierdepending on what you are doing and how you are doing it, you can use Monitor, Mutex, ...or do an exclusive open on an existing file to do the locking
2.DateTime.Now.ToFileTime() + user ID
DateTime now = DateTime.Now;
string TimeTag = now.Year.ToString() + now.Month.ToString() + now.Day.ToString() + now.Hour.ToString() + now.Minute.ToString() + now.Second.ToString() + now.Millisecond.ToString() + now.DayOfYear.ToString();
string UploadFileName = TimeTag.ToString() + filename.PostedFile.ContentLength.ToString() + "_" + 文件名;