开发者

write a file to the users desktop in c#

I want to write a simple text file from my winform app in c# directly to the user's de开发者_运维知识库sktop and not be denied. How can I get the path? Thanks in advance.


Use Environment.SpecialFolder to get the path to the desktop. You may need to run elevated to write to this folder.

Edit: You also need to ensure that your administrative user has access to the desktop folder. For example:

write a file to the users desktop in c#

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜