Search code examples
vb.netembedded-resource

VB.NET Copy a file from resource to hard disk


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."

<code>IO.File.WriteAllText(MyPath, My.Resources.MyFile)</code>  

But I have administrator rights. Is there any other code to copy a file from resource?

My OS is Win XP Service Pack 3.


Solution

  • I found the solution.

    My path was:

    D:\New Folder
    

    but when I changed it to:

    D:\New Folder\MyFileName.ExtensionName
    

    The problem solved.