如何在开始菜单中创建文件夹 [英] How to create a folder in start menu

查看:171
本文介绍了如何在开始菜单中创建文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想使用c#console应用程序在开始菜单中创建一个文件夹。我不知道如何开始。我将非常感谢你的帮助。

Hi,
I want to create a folder in start menu using c# console application. I don''t know how to start. I shall be thankful for your help.

推荐答案

代码非常简单:
string startMenuPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonStartMenu);
DirectoryInfo di = new DirectoryInfo(startMenuPath);
di.CreateSubdirectory("Testfolder");

但是 (而且它很大但是) - 你需要管理员权限来做这件事,否则你会得到一个拒绝访问例外。

But (and it''s a big but) - you will need admin privileges to do it, or you will get an "access denied" exception.


这篇关于如何在开始菜单中创建文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆