VB.NET 将文件从资源复制到硬盘
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13290681/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
VB.NET Copy a file from resource to hard disk
提问by Shahriyar
I want to copy a file from my project program resource to hard disk.
I use this code but it says "Access to the path 'D:\New Folder' is denied."IO.File.WriteAllText(MyPath, My.Resources.MyFile)
But I have administrator rights.Is there any other code to copy a file from resource ?
My OS is Win XP Service Pack 3
Thanks
我想将一个文件从我的项目程序资源复制到硬盘。
我使用此代码,但它显示“拒绝访问路径 'D:\New Folder'。” IO.File.WriteAllText(MyPath, My.Resources.MyFile)
但是我有管理员权限。是否还有其他代码可以从资源中复制文件?
我的操作系统是 Win XP Service Pack 3
谢谢
回答by Shahriyar
I found the solution
My path was :
D:\New Folder
But when I changed it to
D:\New Folder\MyFileName.ExtensionName
The problem solved
我找到了解决方案
我的路径是:
D:\New Folder
但是当我把它改成
D:\New Folder\MyFileName.ExtensionName
问题就解决了

