开发者

Change filename when file drops into folder

开发者 https://www.devze.com 2022-12-14 13:44 出处:网络
I\'m new at c#. I want to be able to drag and drop some .MSG files i开发者_运维知识库nto a folder and I\'d like to change the filenames uniquely. I\'ve no idea what to do. Any ideas?If the file name i

I'm new at c#. I want to be able to drag and drop some .MSG files i开发者_运维知识库nto a folder and I'd like to change the filenames uniquely. I've no idea what to do. Any ideas?


If the file name isn't unique, then it'll be pretty hard to drop it into the folder in the first place - but that's beside the point.

You can watch a folder using the FileSystemWatcher class. You can generate a unique name in a number of ways - something involving Guid.NewGuid() will always work of course.

0

精彩评论

暂无评论...
验证码 换一张
取 消