Results 1 to 9 of 9

Thread: copy file from resources to a specified file/

  1. #1

    Thread Starter
    Fanatic Member manhit45's Avatar
    Join Date
    May 2009
    Location
    Ha noi - Viet Nam
    Posts
    826

    copy file from resources to a specified file/

    I have a font FREE3OF9. (BARCODE FONT).
    I want when user run my program, the Font automatic install on their machine.
    So i want to copy that font to C disk of user :
    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")
    I use above code but it is error.
    I import that font to my resoures .
    And i want to copy that font in my resoure to "C:\WINDOWS\Fonts" of USER .

    HOW CAN I DO THAT ?
    --***----------***-----

    If i help you please rate me.

    Working with Excel * Working with String * Working with Database * Working with array *

    K51 ĐH BÁCH KHOA HÀ NỘI - Khoa CNTT pro.

  2. #2

    Re: copy file from resources to a specified file/

    You say it errors, what's the error? My mind reading skills don't work through the Internet (or well at all for that matter), so can you inform us of the error?

  3. #3
    Hyperactive Member Cyb3rH4Xter's Avatar
    Join Date
    May 2009
    Location
    Sweden
    Posts
    449

    Re: copy file from resources to a specified file/

    You don't need a binarywriter, you can just use copy file:

    System.IO.File.Copy(My.Resources.FRE3O, "C:\WINDOWS\Fonts\FREE3OF9.TTF")

  4. #4

    Thread Starter
    Fanatic Member manhit45's Avatar
    Join Date
    May 2009
    Location
    Ha noi - Viet Nam
    Posts
    826

    Re: copy file from resources to a specified file/

    Quote Originally Posted by Cyb3rH4Xter View Post
    You don't need a binarywriter, you can just use copy file:

    System.IO.File.Copy(My.Resources.FRE3O, "C:\WINDOWS\Fonts\FREE3OF9.TTF")
    NO, I tried it. BUT IT IS ERROR. BECAUSE the file in resource is not string type.
    --***----------***-----

    If i help you please rate me.

    Working with Excel * Working with String * Working with Database * Working with array *

    K51 ĐH BÁCH KHOA HÀ NỘI - Khoa CNTT pro.

  5. #5

    Thread Starter
    Fanatic Member manhit45's Avatar
    Join Date
    May 2009
    Location
    Ha noi - Viet Nam
    Posts
    826

    Re: copy file from resources to a specified file/

    Please someone help me ???
    --***----------***-----

    If i help you please rate me.

    Working with Excel * Working with String * Working with Database * Working with array *

    K51 ĐH BÁCH KHOA HÀ NỘI - Khoa CNTT pro.

  6. #6

    Thread Starter
    Fanatic Member manhit45's Avatar
    Join Date
    May 2009
    Location
    Ha noi - Viet Nam
    Posts
    826

    Re: copy file from resources to a specified file/

    In short. How can i copy from a file in my resource to another folder in hard disk ?
    --***----------***-----

    If i help you please rate me.

    Working with Excel * Working with String * Working with Database * Working with array *

    K51 ĐH BÁCH KHOA HÀ NỘI - Khoa CNTT pro.

  7. #7

    Thread Starter
    Fanatic Member manhit45's Avatar
    Join Date
    May 2009
    Location
    Ha noi - Viet Nam
    Posts
    826

    Re: copy file from resources to a specified file/

    any helps ?
    --***----------***-----

    If i help you please rate me.

    Working with Excel * Working with String * Working with Database * Working with array *

    K51 ĐH BÁCH KHOA HÀ NỘI - Khoa CNTT pro.

  8. #8
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    Re: copy file from resources to a specified file/

    Quote Originally Posted by manhit45 View Post
    I have a font FREE3OF9. (BARCODE FONT).
    I want when user run my program, the Font automatic install on their machine.
    So i want to copy that font to C disk of user :
    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")
    I use above code but it is error.
    I import that font to my resoures .
    And i want to copy that font in my resoure to "C:\WINDOWS\Fonts" of USER .

    HOW CAN I DO THAT ?
    What was the error you got? You never said.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  9. #9

    Thread Starter
    Fanatic Member manhit45's Avatar
    Join Date
    May 2009
    Location
    Ha noi - Viet Nam
    Posts
    826

    Re: copy file from resources to a specified file/

    ok
    Infact , after i copy that file.
    THE COPY IS NOT SAME WITH ORIGINAL FILE. And it is not barcode type.
    while original file is barcode type.
    --***----------***-----

    If i help you please rate me.

    Working with Excel * Working with String * Working with Database * Working with array *

    K51 ĐH BÁCH KHOA HÀ NỘI - Khoa CNTT pro.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width