我试图写一个文件到一个真实存在并且由我创建的目录中G:\\
,即not a system directory or in root drive
像这样
File.WriteAllBytes(directoryPath.Replace("wav", "mp3"), asBytesArray);
但是这让我有这个例外:
An unhandled exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll Additional information: Access to the path 'G:\Song' is denied.
我该如何解决这个问题?请帮忙!
这是在我调试时Visual Studio
,我不知道如何为作为调试运行的应用程序提供管理权限