|
-
Dec 28th, 2009, 08:00 AM
#1
Thread Starter
Fanatic Member
Help about resource
Hi every body.
How can i copy a file in my resource to other folder in my computer.
My file is font file (barcode)
-
Dec 28th, 2009, 08:06 AM
#2
Re: Help about resource
When you read the resource from My.Resources you will get it as some type of object. If the original file was a font file then that type may be a Font, otherwise it would be a Byte array. If it's a Byte array then you would be able to call File.WriteAllBytes. If it's a Font then wouldn't need to save it as a file to use it in your app. If you need a file for some other reason then, if it's possible, I think you'd have to use the Windows API to save it. Can you check which type it is?
-
Dec 28th, 2009, 08:13 AM
#3
Thread Starter
Fanatic Member
Re: Help about resource
 Originally Posted by jmcilhinney
When you read the resource from My.Resources you will get it as some type of object. If the original file was a font file then that type may be a Font, otherwise it would be a Byte array. If it's a Byte array then you would be able to call File.WriteAllBytes. If it's a Font then wouldn't need to save it as a file to use it in your app. If you need a file for some other reason then, if it's possible, I think you'd have to use the Windows API to save it. Can you check which type it is?
JM. help me please. IT is array byte().
I used this :
Code:
'Dim binWriter = New IO.BinaryWriter(IO.File.Create("C:\WINDOWS\Fonts\FREE3OF9.TTF"))
'binWriter.Write(My.Resources.FRE3O)
'binWriter.Close()
'Process.Start("C:\WINDOWS\Fonts\FREE3OF9.TTF")
But it did not work. 
In fact , it work , but that file is not same with original file. And it is not barcode type.
-
Dec 28th, 2009, 08:51 AM
#4
Re: Help about resource
I suggest that you go back and read my previous post again.
-
Dec 28th, 2009, 09:29 AM
#5
Thread Starter
Fanatic Member
Re: Help about resource
I tried this but it did not work :
Code:
Dim strw As New StreamWriter("C:\WINDOWS\Fonts\FREE3OF9.TTF")
strw.Close()
File.WriteAllBytes("C:\WINDOWS\Fonts\FREE3OF9.TTF", My.Resources.FRE3OF9X)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|